library cinder
PHP ORM Layer
cinder/cinder
PHP ORM Layer
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Cinder
Cinder is a Mozilla Licensed PHP ORM Layer Written By Chareice., (*1)
Installing Cinder using Composer
-
Add "cinder/cinder" as dependency in your project's composer.json file., (*2)
{
"require": {
"cinder/cinder": "dev-master"
}
}
-
Download and install Composer., (*3)
curl -s "http://getcomposer.org/installer" | php, (*4)
-
Install your dependencies., (*5)
php composer.phar install, (*6)
-
Require Composer's autoloader by adding the following line to your code's bootstrap process., (*7)
require '/path/to/vendor/autoload.php';, (*8)
Usage
-
At first, User must configure the connection to Database by using PDO Style:, (*9)
<?php
require "vendor/autoload.php";
Cinder\Cinder::Config("mysql:host=localhost;dbname=app_test","root","pass");
-
Then user can manipulate Cinder by offer it a $options variable like this:, (*10)
$options = array(
"table" => "article",
"primary" => "id",
"field" => "title",
"value" => "Hello Wrold"
);
$article = Cinder\Cinder::getInstance($options);
Now $article variable is the ORM Object that mapping to your row in article table which title equals "Hello World"., (*11)