Hi Everyone
I want to add extra attribute in Model from another table
but I don't want to generate a related Model AR for the last one table
for example
If I have the AR Model for table related_table I could use
How could achieve the similar but directly to the table (without relatedTableAR)
like this
Thanks!
I want to add extra attribute in Model from another table
but I don't want to generate a related Model AR for the last one table
for example
If I have the AR Model for table related_table I could use
public function relations() { return array( 'product' => array(self::BELONGS_TO, 'relatedTableAR', 'relId') ) )
How could achieve the similar but directly to the table (without relatedTableAR)
like this
public function relations() { return array( //'product' => array(self::BELONGS_TO, 'relatedTableAR', 'relId') 'Products' => array(self::BELONGS_TO, ':related_table', '' , 'on'=>'related_table.id=t.rel_id','select'=>'id,price'), ) )
Thanks!