示例#1
0
文件: Like.php 项目: skapl/design
 /**
  * Before Delete, remove LikeCount (Cache) of target object.
  * Remove activity
  */
 protected function beforeDelete()
 {
     Yii::app()->cache->delete('likes_' . $this->object_model . "_" . $this->object_id);
     // Delete Activity
     // Currently we need to delete this manually, because the activity object is NOT bound to the Like
     // Instead is it bound to the Like Target (This should changed)
     $activity = Activity::model()->findByAttributes(array('type' => 'Interest', 'module' => 'like', 'object_model' => $this->object_model, 'object_id' => $this->object_id, 'created_by' => $this->created_by));
     if ($activity) {
         $activity->delete();
     }
     Notification::remove('Interest', $this->id);
     return parent::beforeDelete();
 }
示例#2
0
文件: Comment.php 项目: ahdail/humhub
 /**
  * Before Delete, remove LikeCount (Cache) of target object.
  * Remove activity
  */
 protected function beforeDelete()
 {
     $this->flushCache();
     Notification::remove('Comment', $this->id);
     return parent::beforeDelete();
 }
 /**
  * Before Delete, remove FavoritesCount (Cache) of target object.
  */
 protected function beforeDelete()
 {
     Yii::app()->cache->delete('favorites_' . $this->object_model . "_" . $this->object_id);
     return parent::beforeDelete();
 }