2017 © Pedro Peláez
 

library potato-orm

A basic CRUD Object Relational Mapper

image

sirolad/potato-orm

A basic CRUD Object Relational Mapper

  • Thursday, November 26, 2015
  • by sirolad
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PotatoORM

License Build Status Quality Score, (*1)

This package performs basic CRUD operation using Object Relational Mapping(ORM) :, (*2)

DIRECTORY STRUCTURE

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

Installation

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"
    }

Usage

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)

find

``` 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)

Update

    $goat = Goat::where('name', 'JackBauer');
    $goat->password = "wetina";
    $goat->save();

Change log

Please check out CHANGELOG file for information on what has changed recently., (*10)

Testing

``` bash $ vendor/bin/phpunit test, (*11)


``` composer $ composer test

Contributing

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

Credits

PotatoORM is developed and maintained by Surajudeen Akande., (*13)

License

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

Supported Databases

bash MySQL PGSQL, (*15)

The Versions

26/11 2015

dev-master

9999999-dev https://github.com/andela-sakande/potatoORM

A basic CRUD Object Relational Mapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Surajudeen Akande

orm database php