Hatch - a small lightweight ORM for PHP
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Corvum
README.md
composer.json

README.md

Hatch

Hatch - a small lightweight ORM for PHP

##Installation

###Install with Composer

If you're using Composer to manage dependencies, you can add Hatch with it.

{
    "require": {
        "corvum/hatch": "dev-master"
    }
}

##Usage

###Setup

require('/vendor/autoload.php');

###Basic Usage

$dbInfo = ['type'=>'sqlsrv|mysql', 'host'=>'127.0.0.1', 'db'=>'database', 'user'=>'root', 'password'=>'password'];
$db = new \Corvum\Hatch($dbInfo);
$db->connect();
$user = $db->find('user','first_name = ?',['William']);
$user->first_name = 'Billiam';
$db->store($user);

$newUser = $db->dispense('user'):
$newUser->first_name = 'Test';
$db->store($newUser);
$db->trash($newUser);

##Documentation

Documentation