dev-master
9999999-dev https://github.com/andela-sakande/potatoORMA basic CRUD Object Relational Mapper
MIT
The Requires
The Development Requires
by Surajudeen Akande
orm database php
A basic CRUD Object Relational Mapper
This package performs basic CRUD operation using Object Relational Mapping(ORM) :, (*2)
src/ core package code |DB database connection class |Entities samples class to test the model class |Exceptions custom exception classes |Libraries helper classes tests/ tests of the core package
PHP 5.3+ and Composer are required., (*3)
Via Composer, (*4)
``` bash $ composer require sirolad/potato-orm, (*5)
or ``` composer.json "require": { "sirolad/potato-orm": "dev-master" }
Extend Potato
class like so
``` php
class Goat extends Potato
{
}, (*6)
The following method can be used to access the classes ## getAll ``` php $goat = Goat::getAll(); print_r($goat);
This should print out all the goats in the goats table of Goat class., (*7)
``` php $goat = Goat::find(1); $goat->password = "ewure"; echo $goat->save();, (*8)
This should find the goat with `id=1` in the goats table and change the password to `ewure`. ## save ```php $goat = new Goat(); $goat->name = "billy"; $goat->age = 25; $goat->job = "developer"; $goat->save();
This should insert a record for goat billy
in the goats table., (*9)
$goat = Goat::where('name', 'JackBauer'); $goat->password = "wetina"; $goat->save();
Please check out CHANGELOG file for information on what has changed recently., (*10)
``` bash $ vendor/bin/phpunit test, (*11)
``` composer $ composer test
Please check out CONTRIBUTING file for detailed contribution guidelines., (*12)
PotatoORM is developed and maintained by Surajudeen Akande
., (*13)
PotatoORM is released under the MIT Licence. See the bundled LICENSE file for details., (*14)
bash
MySQL
PGSQL
, (*15)
A basic CRUD Object Relational Mapper
MIT
orm database php