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


PHP ActiveRecord::afterSave方法代码示例

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


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

示例1: afterSave

 public function afterSave()
 {
     if ($this->isNewRecord) {
         $this->createTheme('site');
     }
     return parent::afterSave();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:7,代码来源:Theme.php

示例2: afterSave

 public function afterSave()
 {
     parent::afterSave();
     $sql = "UPDATE p_nfy_subscription_categories " . "set category = 'role_{$this->role_name}.' " . "where category = 'role_{$this->oldName}.';";
     Yii::app()->db->createCommand($sql)->execute();
     return true;
 }
开发者ID:reggi49,项目名称:plansys,代码行数:7,代码来源:Role.php

示例3: afterSave

 /**
  * After save event
  */
 public function afterSave()
 {
     // Update Topic
     PersonalMessageTopic::model()->updateByPk($this->topic_id, array('last_reply_created_at' => $this->created_at, 'last_reply_author_id' => $this->user_id));
     // Send notifications
     PersonalMessageTopic::model()->sendNotifications($this->topic_id, $this->id);
     return parent::afterSave();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:11,代码来源:PersonalMessageReply.php

示例4: afterSave

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

示例5: afterSave

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

示例6: 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:buildshop,项目名称:bs-common,代码行数:11,代码来源:LanguageModel.php

示例7: afterSave

 public function afterSave()
 {
     if ($this->getIsNewRecord()) {
         $this->addMessageCopies();
         if (empty($this->conversation_id)) {
             $this->conversation_id = $this->id;
             $this->setIsNewRecord(FALSE);
             $this->save(FALSE);
         }
     }
     return parent::afterSave();
 }
开发者ID:wanyos2005,项目名称:hsbf,代码行数:12,代码来源:MsgMessage.php

示例8: afterSave

 public function afterSave()
 {
     parent::afterSave();
     if (count($this->data) == 0) {
         foreach (Sector::model()->findAll() as $sector) {
             $data = new Data();
             $data->metric_id = $this->id;
             $data->sector_id = $sector->id;
             $data->save();
         }
     }
 }
开发者ID:nizsheanez,项目名称:kur.ru,代码行数:12,代码来源:Metric.php

示例9: afterSave

 protected function afterSave()
 {
     if ($this->protected_ip) {
         $this->protected_ip = json_decode($this->protected_ip, TRUE);
     }
     parent::afterSave();
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:7,代码来源:UserProfiles.php

示例10: afterSave

	protected function afterSave() 
	{
		if(parent::afterSave()) {
			return true;
		} else {
			return false;
		}
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:8,代码来源:User.php

示例11: afterSave

 public function afterSave()
 {
     // Process related products
     if ($this->_related !== null) {
         $this->clearRelatedProducts();
         foreach ($this->_related as $id) {
             $related = new ShopRelatedProduct();
             $related->product_id = $this->id;
             $related->related_id = $id;
             $related->save(false, false);
         }
     }
     // Save configurable attributes
     if ($this->_configurable_attribute_changed === true) {
         // Clear
         Yii::app()->db->createCommand()->delete('{{shop_product_configurable_attributes}}', 'product_id = :id', array(':id' => $this->id));
         foreach ($this->_configurable_attributes as $attr_id) {
             Yii::app()->db->createCommand()->insert('{{shop_product_configurable_attributes}}', 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('{{shop_product_configurations}} t')->where(array('in', 't.configurable_id', array($this->id)))->queryAll();
         foreach ($query as $row) {
             $model = ShopProduct::model()->findByPk($row['product_id']);
             if ($model) {
                 $this->updatePrices($model);
             }
         }
     }
     //  $this->date_update = date('Y-m-d H:i:s');
     return parent::afterSave();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:36,代码来源:ShopProduct.php

示例12: afterSave

 protected function afterSave()
 {
     if ($this->isNewRecord) {
         $model = new UserProfiles();
         $model->balance = UserProfiles::DEFAULT_BALANCE;
         $model->user_id = $this->getPrimaryKey();
         $model->save(FALSE);
     }
     parent::afterSave();
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:10,代码来源:Users.php

示例13: afterSave

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

示例14: afterSave

 public function afterSave()
 {
     if (parent::afterSave()) {
         Yii::app()->cache->flush('languages');
     }
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:6,代码来源:Language.php

示例15: afterSave

 public function afterSave()
 {
     parent::afterSave();
     return true;
 }
开发者ID:rizabudi,项目名称:plansys,代码行数:5,代码来源:Role.php


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