/** * 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())); }