Esempio n. 1
0
 public function modelRelationMap()
 {
     return ['items' => array('type' => 'hasMany', 'class' => Item::className(), 'link' => array('orderId' => 'id'), 'onSaveAll' => ActiveRecord::SAVE_CASCADE, 'onDeleteFull' => ActiveRecord::DELETE_CASCADE, 'autoLinkType' => ActiveRecord::LINK_FROM_PARENT_MAINT, 'allToArray' => true, 'autoLink' => array('fromParent' => array('orderId' => 'id', 'customerId' => 'customerId'))), 'customer' => array('type' => 'belongsTo', 'class' => Customer::className(), 'link' => array('id' => 'customerId'))];
 }