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.


$customer = new Customer();

$customer->name = 'James';

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


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')


$user->first_name = 'Jamie';


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.


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).