2017 © Pedro Peláez
 

library potato-orm

A simple PHP agnostic ORM

image

wilson/potato-orm

A simple PHP agnostic ORM

  • Monday, January 4, 2016
  • by wil
  • Repository
  • 1 Watchers
  • 1 Stars
  • 142 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Potato-orm

Build Status, (*1)

A simple ORM to insert, read, update, and delete data from a database written in PHP., (*2)

Install

Via Composer, (*3)

``` bash $ composer require Wilson/potato-orm, (*4)


## Usage - Simply extend the base class. The base class is an abstract class called "Base". So for example if you have a users table in the database and you wish to perform create, read, update, and delete (CRUD) operations on the table, create a corresponding class like this

use Wilson\Source\Base;, (*5)

class User extends Base {, (*6)

}, (*7)


- Insert a record into the table

$person = new User(); $person->name = "Wilson Omokoro"; $person->email = "wilson.omokoro@andela.com"; $person->password = "12345"; $person->save();, (*8)


- Find a particular record in the table

$user = User::find(3); echo $user->result;, (*9)


- Read all records from the table

$users = User::getAll(); print_r($users);, (*10)


- Update a record in the table. For example update the password of the fifth record in the users table:

$user = User::find(5); $user->password = "lkHJu9Z"; $user->save();, (*11)


- Delete a record from the table. For example delete the third record in the users table:

$user = User::destroy(3);, (*12)


## Testing If the folder containing your test classes is "tests"

$ phpunit tests ```, (*13)

Change log

Please see CHANGELOG for more information what has changed recently., (*14)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*15)

Security

If you discover any security related issues, please email wilson.omokoro@andela.com instead of using the issue tracker., (*16)

Credits

Potato-orm is maintained by Wilson Omokoro., (*17)

License

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

The Versions

04/01 2016

dev-master

9999999-dev

A simple PHP agnostic ORM

  Sources   Download

The Requires

 

The Development Requires

by :Wilson Omokoro