コード例 #1
0
ファイル: EavValue.php プロジェクト: kuzmina-mariya/4seasons
 /**
  * Updates the primary key value of the given entity instance in the table that stores EAV attributes values.
  * @param EavActiveRecord $entity EavActiveRecord instance.
  * @return int Returns number of affected rows.
  * @since Version 1.0.1
  */
 public function updateEntityPrimaryKey(EavActiveRecord $entity)
 {
     return $this->updateAll(array('entity_id' => $entity->getPrimaryKey()), 'entity = :entity AND entity_id = :entity_id', array(':entity' => $entity->getEntity(), ':entity_id' => $entity->getOldPrimaryKey()));
 }