ORM Without AR ?

Hello All,

How to use ORM without define the AR. current as i know in YII i need to defined the AR Class to able create ORM.

example:




$customer = new Customer();

$customer->name = 'James';

$customer->email = 'james@example.com';

$customer->save();



i seem that IDIORM have great ORM for it without define the AR. https://github.com/j4mie/idiorm




$user = ORM::for_table('user')

    ->where_equal('username', 'j4mie')

    ->find_one();


$user->first_name = 'Jamie';

$user->save();



is this also possible in YII ? or maybe have extension for it. thank you

You can use the query builder with CDbCommand and at the end call insert() or update() method.

http://www.yiiframework.com/doc/guide/1.1/it/database.query-builder

ok, thanks. i try to find out about this feature and not available. that mean i need to include IDIORM into my yii project.

I’ll evaluate if it would be better to create a model (using Gii, that makes it automatically).