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


PHP BaseModel::afterDelete方法代码示例

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


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

示例1: afterDelete

 public function afterDelete()
 {
     if ($this->order) {
         $this->order->updateTotalPrice();
         $this->order->updateDeliveryPrice();
     }
     return parent::afterDelete();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:8,代码来源:OrderProduct.php

示例2: afterDelete

 /**
  * Delete file, etc...
  */
 public function afterDelete()
 {
     // Delete file
     if (file_exists($this->filePath)) {
         unlink($this->filePath);
     }
     return parent::afterDelete();
 }
开发者ID:bahdall,项目名称:karbella_event,代码行数:11,代码来源:EventImage.php

示例3: afterDelete

 /**
  * Delete related data.
  */
 public function afterDelete()
 {
     // Delete related products
     $this->clearRelatedProducts();
     StoreRelatedProduct::model()->deleteAll('related_id=:id', array('id' => $this->id));
     // Delete categorization
     StoreProductCategoryRef::model()->deleteAllByAttributes(array('product' => $this->id));
     // Delete images
     $images = $this->images;
     if (!empty($images)) {
         foreach ($images as $image) {
             $image->delete();
         }
     }
     // Delete variants
     $variants = StoreProductVariant::model()->findAllByAttributes(array('product_id' => $this->id));
     foreach ($variants as $v) {
         $v->delete();
     }
     // Clear configurable attributes
     Yii::app()->db->createCommand()->delete('StoreProductConfigurableAttributes', 'product_id=:id', array(':id' => $this->id));
     // Delete configurations
     Yii::app()->db->createCommand()->delete('StoreProductConfigurations', 'product_id=:id', array(':id' => $this->id));
     Yii::app()->db->createCommand()->delete('StoreProductConfigurations', 'configurable_id=:id', array(':id' => $this->id));
     // Delete from wish lists
     Yii::import('application.modules.store.models.wishlist.StoreWishlistProducts');
     $wishlistProduct = StoreWishlistProducts::model()->findByAttributes(array('product_id' => $this->id));
     if ($wishlistProduct) {
         $wishlistProduct->delete();
     }
     return parent::afterDelete();
 }
开发者ID:bahdall,项目名称:karbella_event,代码行数:35,代码来源:StoreProduct.php

示例4: afterDelete

 /**
  * After delete event
  */
 public function afterDelete()
 {
     $profile = $this->profile;
     if ($profile) {
         $profile->delete();
     }
     parent::afterDelete();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:11,代码来源:User.php

示例5: afterDelete

	/**
	 * Delete related data.
	 */
	public function afterDelete()
	{

		// Delete images
		$images = $this->images;
		if(!empty($images))
		{
			foreach ($images as $image)
				$image->delete();
		}
		

		return parent::afterDelete();
	}
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:17,代码来源:Article.php

示例6: afterDelete

 /**
  * After delete module
  */
 public function afterDelete()
 {
     self::loadModuleClass($this->name)->afterRemove();
     self::deleteCaches();
     self::buildEventsFile();
     return parent::afterDelete();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:10,代码来源:SystemModules.php

示例7: afterDelete

 public function afterDelete()
 {
     //Remove all products with this category set as main.
     $products = StoreProductCategoryRef::model()->findAllByAttributes(array('category' => $this->id, 'is_main' => '1'));
     foreach ($products as $p) {
         $productModel = StoreProduct::model()->findByPk($p->product);
         if ($productModel) {
             $productModel->delete();
         }
     }
     // Remove all category-product relations
     StoreProductCategoryRef::model()->deleteAllByAttributes(array('category' => $this->id, 'is_main' => '0'));
     $this->clearRouteCache();
     return parent::afterDelete();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:15,代码来源:StoreCategory.php

示例8: afterDelete

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

示例9: afterDelete

 /**
  * @return bool
  */
 public function afterDelete()
 {
     foreach ($this->products as $ordered_product) {
         $ordered_product->delete();
     }
     return parent::afterDelete();
 }
开发者ID:bahdall,项目名称:karbella_event,代码行数:10,代码来源:Order.php

示例10: afterDelete

	/**
	 * Delete related data.
	 */
	public function afterDelete()
	{
		return parent::afterDelete();
	}
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:7,代码来源:Objects.php

示例11: afterDelete

 public function afterDelete()
 {
     // Clear type attribute relations
     StoreTypeAttribute::model()->deleteAllByAttributes(array('type_id' => $this->id));
     return parent::afterDelete();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:6,代码来源:StoreProductType.php

示例12: afterDelete

 public function afterDelete()
 {
     // Clear product relations
     StoreProduct::model()->updateAll(array('manufacturer_id' => new CDbExpression('NULL')), 'manufacturer_id = :id', array(':id' => $this->id));
     return parent::afterDelete();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:6,代码来源:StoreManufacturer.php

示例13: afterDelete

	public function afterDelete()
	{
		// Delete options
		foreach($this->options as $o)
			$o->delete();

		// Delete relations used in product type.
		EavTypeAttribute::model()->deleteAllByAttributes(array('attribute_id'=>$this->id));

		// Delete attributes assigned to products
		$conn = $this->getDbConnection();
		$command = $conn->createCommand("DELETE FROM eav_variants WHERE attribute_name='{$this->name}'");
		$command->execute();

		return parent::afterDelete();
	}
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:16,代码来源:EavOptions.php

示例14: afterDelete

 protected function afterDelete()
 {
     parent::afterDelete();
     vPorderDetail::model()->deleteAll(array('condition' => 'parent_id= :id', 'params' => array(':id' => $this->id)));
 }
开发者ID:rusli-nasir,项目名称:ERP_Accounting_Indonesia,代码行数:5,代码来源:vPorder.php

示例15: afterDelete

 /**
  * Delete file, etc...
  */
 public function afterDelete()
 {
     // Delete file
     if (file_exists($this->filePath)) {
         unlink($this->filePath);
     }
     // If main image was deleted
     if ($this->is_main) {
         // Get first image and set it as main
         $model = PageImage::model()->find();
         if ($model) {
             $model->is_main = 1;
             $model->save(false);
         }
     }
     return parent::afterDelete();
 }
开发者ID:bahdall,项目名称:karbella_event,代码行数:20,代码来源:PageImage.php


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