コード例 #1
0
ファイル: Media.php プロジェクト: keyeMyria/CRM
 public function afterDelete()
 {
     parent::afterDelete();
     // Reset path if name was changed:
     $this->_path = null;
     if (file_exists($this->getPath())) {
         unlink($this->getPath());
     }
     // if theme is deleted which is default, unset default theme setting
     if ($this->id === Yii::app()->settings->defaultTheme) {
         Yii::app()->settings->defaultTheme = null;
         Yii::app()->settings->enforceDefaultTheme = false;
         Yii::app()->settings->save();
     }
 }
コード例 #2
0
ファイル: Media.php プロジェクト: shuvro35/X2CRM
 public function afterDelete()
 {
     parent::afterDelete();
     // Reset path if name was changed:
     $this->_path = null;
     if (file_exists($this->getPath())) {
         $media = Media::model()->findByAttributes(array('uploadedBy' => $this->uploadedBy, 'fileName' => $this->fileName));
         // Only delete the file if it is the last media object
         // To use it.
         if (!$media) {
             unlink($this->getPath());
         }
     }
     // if theme is deleted which is default, unset default theme setting
     if ($this->id === Yii::app()->settings->defaultTheme) {
         Yii::app()->settings->defaultTheme = null;
         Yii::app()->settings->enforceDefaultTheme = false;
         Yii::app()->settings->save();
     }
 }
コード例 #3
0
ファイル: Groups.php プロジェクト: dsyman2/X2CRM
 /**
  * Delete associated group to user records 
  */
 public function afterDelete()
 {
     GroupToUser::model()->deleteAll(array('condition' => 'groupId=' . $this->id));
     parent::afterDelete();
 }
コード例 #4
0
ファイル: Actions.php プロジェクト: tymiles003/X2CRM
 /**
  * Deletes the action reminder event, if any
  * Fires the onAfterDelete event in {@link X2Model::afterDelete}
  */
 public function afterDelete()
 {
     X2Model::model('Events')->deleteAllByAttributes(array('associationType' => 'Actions', 'associationId' => $this->id, 'type' => 'action_reminder'));
     X2Model::model('ActionText')->deleteByPk($this->id);
     parent::afterDelete();
 }
コード例 #5
0
ファイル: Media.php プロジェクト: xl602/X2CRM
 public function afterDelete()
 {
     parent::afterDelete();
     // Reset path if name was changed:
     $this->_path = null;
     $this->collectGarbage();
     // if theme is deleted which is default, unset default theme setting
     if ($this->id === Yii::app()->settings->defaultTheme) {
         Yii::app()->settings->defaultTheme = null;
         Yii::app()->settings->enforceDefaultTheme = false;
         Yii::app()->settings->save();
     }
 }
コード例 #6
0
ファイル: X2List.php プロジェクト: xl602/X2CRM
 /**
  * When a list is deleted, remove its entries in x2_list_items
  */
 public function afterDelete()
 {
     CActiveRecord::model('X2ListItem')->deleteAllByAttributes(array('listId' => $this->id));
     // delete all the things!
     parent::afterDelete();
 }