Ejemplo n.º 1
0
 public function addProductCategoryI18n(ProductCategoryI18n $l)
 {
     $this->collProductCategoryI18ns[] = $l;
     $l->setProductCategory($this);
 }
 public function actionUpdateIsReleased()
 {
     if (Yii::app()->user->checkAccess('updateProductCategory') == 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 ProductCategory::model()->updateByPk($id, array('is_released' => $isReleased));
     } else {
         echo ProductCategoryI18n::model()->updateAll(array('is_released' => $isReleased), 'owner_id = :owner_id AND lang = :lang', array(':owner_id' => $id, ':lang' => $language));
     }
 }