ORM - PHP Library
, (*1)
ORM., (*2)
Installation
Install using composer:, (*3)
$ composer require assouan/orm
Usage
orm($table, $database, $connection);
Example
$pdo = new \PDO
(
'mysql:host=localhost;port=3306;charset=UTF8',
'root',
'',
array
(
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
)
);
ORM::setDefaultConnection($pdo);
ORM::setDefaultDatabase('user');
ORM::setDefaultTable('account');
foreach (orm()->selects() as $account)
{
echo $account->email.'<br />';
$profile = orm('account_profile')->selectById( $account->id );
echo $profile->first_name.' '.$profile->last_name.'<hr />';
}