/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param ProductI18n $value A ProductI18n object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(ProductI18n $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = serialize(array((string) $obj->getId(), (string) $obj->getCulture())); } // if key === null self::$instances[$key] = $obj; } }
public function actionUpdateIsReleased() { if (Yii::app()->user->checkAccess('updateProduct') == false) { throw new CHttpException(403); } $id = Yii::app()->request->getPost('id'); $language = Yii::app()->request->getPost('language'); $isReleased = Yii::app()->request->getPost('is_released'); if ($language == I18nHelper::getFrontendSourceLanguage()) { echo Product::model()->updateByPk($id, array('is_released' => $isReleased)); } else { echo ProductI18n::model()->updateAll(array('is_released' => $isReleased), 'owner_id = :owner_id AND lang = :lang', array(':owner_id' => $id, ':lang' => $language)); } }
/** * @param ProductI18n $productI18n The productI18n object to add. */ protected function doAddProductI18n($productI18n) { $this->collProductI18ns[] = $productI18n; $productI18n->setProduct($this); }
public function addProductI18n(ProductI18n $l) { $this->collProductI18ns[] = $l; $l->setProduct($this); }