示例#1
0
 public function beforeDelete()
 {
     if ($this->is_system) {
         return false;
     }
     return parent::beforeDelete();
 }
示例#2
0
文件: Follow.php 项目: ahdail/humhub
 protected function beforeDelete()
 {
     // ToDo: Handle this via event of User Module
     if ($this->object_model == 'User') {
         $user = User::model()->findByPk($this->user_id);
         $activity = Activity::model()->contentContainer($user)->findByAttributes(array('type' => "ActivityUserFollowsUser", 'object_id' => $this->object_id));
         if ($activity !== null) {
             $activity->delete();
         }
     }
     return parent::beforeDelete();
 }
示例#3
0
 public function beforeDelete()
 {
     Yii::app()->cache->delete($this->getCacheId());
     RuntimeCache::Remove($this->getCacheId());
     return parent::beforeDelete();
 }
示例#4
0
 protected function beforeDelete()
 {
     $path = $this->getPath();
     // Make really sure, that we dont delete something else :-)
     if ($this->guid != "" && $this->folder_uploads != "" && is_dir($path)) {
         $files = glob($path . DIRECTORY_SEPARATOR . "*");
         foreach ($files as $file) {
             if (is_file($file)) {
                 unlink($file);
             }
         }
         rmdir($path);
     }
     return parent::beforeDelete();
 }
示例#5
0
 /**
  * Called before this entry will deleted
  *
  * @return type
  */
 public function beforeDelete()
 {
     $cacheId = "wallEntryCount_" . $this->wall_id;
     Yii::app()->cache->delete($cacheId);
     return parent::beforeDelete();
 }
 public function beforeDelete()
 {
     Yii::app()->cache->delete(self::STATES_CACHE_ID_PREFIX . $this->room_id);
     return parent::beforeDelete();
 }
示例#7
0
 /**
  * Before delete record
  *
  * @return type
  */
 protected function beforeDelete()
 {
     Yii::app()->cache->delete('userSpaces_' . $this->user_id);
     return parent::beforeDelete();
 }
示例#8
0
 /**
  * Before deleting a profile field, inform underlying ProfileFieldType for
  * cleanup.
  */
 public function beforeDelete()
 {
     if ($this->is_system) {
         return false;
     }
     $this->fieldType->delete();
     return parent::beforeDelete();
 }