2017 © Pedro Peláez
 

library potato-orm

A lightweight ORM built using PHP and PDO.

image

andela-aonyango/potato-orm

A lightweight ORM built using PHP and PDO.

  • Friday, February 26, 2016
  • by andrizzle
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

potato-orm

Latest Version on Packagist ![Software License][ico-license] Build Status [![Coverage Status][ico-coveralls]][link-coveralls] Quality Score ![Total Downloads][ico-downloads], (*1)

A light-weight ORM which allows you to insert records into a database, retrieve them, update them, and delete them., (*2)

Install

Via Composer, (*3)

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

In the package directory, run
``` bash
$ composer install

Usage

Edit the example .env provided in the root of this package with the database settings you will use (make sure you .gitignore YOUR .env file). The one given uses MYSQL settings. PDO supports many database drivers so you can get familiar with what are valid/invalid inputs for the DSN and so on., (*5)

Sample Table

create table Person (
    id int unsigned auto_increment primary key,
    first_name varchar(30) not null,
    last_name varchar(30) not null,
    age int(2),
    gender varchar(7)
);

Sample Usage

``` php first_name = "yua"; $person->last_name = "madha"; $person->age = 73; // the add() method inserts an object and returns the last inserted id $id = $person->add(); // retrieve the just-added person $test = $person->find($id); print_r($test); $test->gender = "female"; $test->update(); // is the update successful print_r($test->find($id)); // delete the person from the database $test->remove(); // retrieve all people print_r($person->findAll()); ?>, (*6)


### Change log Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ### Testing ``` bash $ composer test

Contributing

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

Security

If you discover any security related issues, please email andrew.onyango@andela.com instead of using the issue tracker., (*8)

Credits

License

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

The Versions

26/02 2016

dev-master

9999999-dev https://github.com/andela-aonyango/potato-orm

A lightweight ORM built using PHP and PDO.

  Sources   Download

MIT

The Requires

 

The Development Requires

andela-aonyango potato-orm

26/02 2016

v1.0.3

1.0.3.0 https://github.com/andela-aonyango/potato-orm

A lightweight ORM built using PHP and PDO.

  Sources   Download

MIT

The Requires

 

The Development Requires

andela-aonyango potato-orm

25/02 2016

v1.0.2

1.0.2.0 https://github.com/andela-aonyango/potato-orm

A lightweight ORM built using PHP and PDO.

  Sources   Download

MIT

The Requires

 

The Development Requires

andela-aonyango potato-orm

24/02 2016

1.0.1

1.0.1.0 https://github.com/andela-aonyango/potato-orm

A lightweight ORM built using PHP and PDO.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

andela-aonyango potato-orm

20/02 2016

1.0

1.0.0.0 https://github.com/andela-aonyango/potato-orm

A lightweight ORM built using PHP and PDO.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

andela-aonyango potato-orm