当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseModel::afterSave方法代码示例

本文整理汇总了PHP中BaseModel::afterSave方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::afterSave方法的具体用法?PHP BaseModel::afterSave怎么用?PHP BaseModel::afterSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseModel的用法示例。


在下文中一共展示了BaseModel::afterSave方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterSave

 public function afterSave()
 {
     // Leave only one default language
     if ($this->default) {
         self::model()->updateAll(array('default' => 0), 'id != ' . $this->id);
     }
     return parent::afterSave();
 }
开发者ID:Aplay,项目名称:anetika_site,代码行数:8,代码来源:SSystemLanguage.php

示例2: afterSave

 /**
  * @return boolean
  */
 public function afterSave()
 {
     $this->order->updateTotalPrice();
     $this->order->updateDeliveryPrice();
     if ($this->isNewRecord) {
         $product = StoreProduct::model()->findByPk($this->product_id);
         $product->decreaseQuantity();
     }
     return parent::afterSave();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:13,代码来源:OrderProduct.php

示例3: afterSave

 public function afterSave()
 {
     Yii::app()->cache->delete(Yii::app()->currency->cacheKey);
     if ($this->default) {
         StoreCurrency::model()->updateAll(array('default' => 0), 'id != :id', array(':id' => $this->id));
     }
     if ($this->main) {
         StoreCurrency::model()->updateAll(array('main' => 0), 'id != :id', array(':id' => $this->id));
     }
     parent::afterSave();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:11,代码来源:StoreCurrency.php

示例4: afterSave

 protected function afterSave()
 {
     parent::afterSave();
     return true;
 }
开发者ID:Aplay,项目名称:myhistorypark_site,代码行数:5,代码来源:Article0.php

示例5: afterSave

 /**
  * After save event
  */
 public function afterSave()
 {
     // Clear payment relations
     StoreDeliveryPayment::model()->deleteAllByAttributes(array('delivery_id' => $this->id));
     foreach ($this->payment_methods as $pid) {
         $model = new StoreDeliveryPayment();
         $model->delivery_id = $this->id;
         $model->payment_id = $pid;
         $model->save(false);
     }
     return parent::afterSave();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:15,代码来源:StoreDeliveryMethod.php

示例6: afterSave

 public function afterSave()
 {
     // Process related products
     if ($this->_related !== null) {
         $this->clearRelatedProducts();
         foreach ($this->_related as $id) {
             $related = new StoreRelatedProduct();
             $related->product_id = $this->id;
             $related->related_id = $id;
             $related->save();
         }
     }
     // Save configurable attributes
     if ($this->_configurable_attribute_changed === true) {
         // Clear
         Yii::app()->db->createCommand()->delete('StoreProductConfigurableAttributes', 'product_id = :id', array(':id' => $this->id));
         foreach ($this->_configurable_attributes as $attr_id) {
             Yii::app()->db->createCommand()->insert('StoreProductConfigurableAttributes', array('product_id' => $this->id, 'attribute_id' => $attr_id));
         }
     }
     // Process min and max price for configurable product
     if ($this->use_configurations) {
         $this->updatePrices($this);
     } else {
         // Check if product is configuration
         $query = Yii::app()->db->createCommand()->from('StoreProductConfigurations t')->where(array('in', 't.configurable_id', array($this->id)))->queryAll();
         foreach ($query as $row) {
             $model = StoreProduct::model()->findByPk($row['product_id']);
             if ($model) {
                 $this->updatePrices($model);
             }
         }
     }
     $this->updated = date('Y-m-d H:i:s');
     return parent::afterSave();
 }
开发者ID:bahdall,项目名称:karbella_event,代码行数:36,代码来源:StoreProduct.php

示例7: afterSave

 public function afterSave()
 {
     $this->clearRouteCache();
     return parent::afterSave();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:5,代码来源:StoreCategory.php

示例8: afterDelete

 public function afterDelete()
 {
     Yii::app()->cache->delete('page_category_' . $this->url);
     return parent::afterSave();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:5,代码来源:PageCategory.php

示例9: afterSave

 /**
  * After save event
  */
 public function afterSave()
 {
     $this->clearRelations();
     // Process manufacturers
     if (!empty($this->_manufacturers)) {
         foreach ($this->_manufacturers as $id) {
             Yii::app()->db->createCommand()->insert('DiscountManufacturer', array('discount_id' => $this->id, 'manufacturer_id' => $id));
         }
     }
     // Process categories
     if (!empty($this->_categories)) {
         foreach ($this->_categories as $id) {
             Yii::app()->db->createCommand()->insert('DiscountCategory', array('discount_id' => $this->id, 'category_id' => $id));
         }
     }
     return parent::afterSave();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:20,代码来源:Discount.php


注:本文中的BaseModel::afterSave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。