opeyemiabiodun/potato-orm

dev-master 2016-01-11 05:34 UTC

This package is not auto-updated.

Last update: 2024-11-05 05:34:19 UTC


README

Latest Version on Packagist Software License Build Status Code Coverage Scrutinizer Code Quality Total Downloads

CheckPoint 2 - Potato ORM

A Simple PHP ORM (Object Relational Mapper). PSR-2 coding standard was adopted in writing the package. The PSR-4 autoloading convention was also adopted.

Install

Via Composer

$ composer require opeyemiabiodun/potato-orm

Usage

#Create a record in the database

$user = new User();
$user->name = "Tayo";
$user->address = "54, Kilani street, Akarigbo, Jiyanland.";
$user->phone = "07834531265";
$user->save();


#Find a record from the database

$user = User::find($id);


#Update a record

$user = User::find($id);
$user->address = "No. 1 Update grove, off The Past Street, Now Savedland.";
$user->save();


#Delete a record -- returns a boolean

$result = User::destroy($id):


#Find all users in the database - Returns object array

$users = User::getAll();

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email opeyemi.ogunjimi@andela.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.