2017 © Pedro Peláez
 

library potato-orm

This is an ORM package that manages the persistence of database CRUD operations.

image

kola/potato-orm

This is an ORM package that manages the persistence of database CRUD operations.

  • Friday, November 6, 2015
  • by kola.erinoso
  • Repository
  • 0 Watchers
  • 1 Stars
  • 131 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

potato-orm

Build Status Software License Latest Version on Packagist Total Downloads, (*1)

This is an ORM package that manages the persistence of simple database CRUD operations., (*2)

Installation

PHP 5.5+ and Composer are required., (*3)

Via Composer, (*4)

``` bash $ composer require kola/potato-orm, (*5)


``` bash $ composer install

Usage

Create a class with the name of the corresponding table in the database. Extend the class to the base class Model under the namespace Kola\PotatoOrm., (*6)

For instance, a class for dogs or Dogs or dog or Dog table should look like this:, (*7)

``` php namespace Kola\PotatoOrm;, (*8)

class Dog extends Model { }, (*9)


* Create and save a record to database ``` php $dog = new Dog(); $dog->name = "Rex"; $dog->breed= "Alsatian"; $dog->origin = "Germany"; $dog->save();
  • Find and update a record in database

``` php $dog = Dog::find(4); $dog->name = "Bruno"; $dog->save();, (*10)


OR ``` php $dog = Dog::where('name', 'Rex'); $dog->breed = "Rottweiler"; $dog->save();
  • Delete a record

``` php $dog = Dog::destroy(2);, (*11)


Feel free to name the class as the singular of the name of the database table. For instance, `User` class for `users` table. `Note: Plurals of irregular nouns are not supported` For instance, a class `Fish` should map to a table `fish` or `fishs`, not `fishes`. And a class `Child` should map to a table `child` or `childs`, not `children`. ## Supported database Currently, only MYSQL and PostgreSQL are supported. Work towards the support for other popular databases is in progress. ## Change log Please check out [CHANGELOG](CHANGELOG.md) file for information on what has changed recently. ## Testing ``` bash $ vendor/bin/phpunit test

Contributing

Please check out CONTRIBUTING file for detailed contribution guidelines., (*12)

Credits

potato-orm is maintained by Kolawole ERINOSO., (*13)

License

potato-orm is released under the MIT Licence. See the bundled LICENSE file for details., (*14)

The Versions

06/11 2015

dev-master

9999999-dev

This is an ORM package that manages the persistence of database CRUD operations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kolawole Erinoso

orm persistence