public function beforeDelete()
 {
     if ($this->is_system) {
         return false;
     }
     return parent::beforeDelete();
 }
Example #2
1
 /**
  * @inheritdoc
  */
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         FileHelper::removeDirectory(Yii::$app->file->dir . '/' . $this->id . '/');
         return true;
     }
     return false;
 }
 public function beforeDelete()
 {
     foreach ($this->getUploads() as $file) {
         $file->delete();
     }
     return parent::beforeDelete();
 }
Example #4
0
 public function beforeDelete()
 {
     if (!empty($this->image->id)) {
         $this->image->delete();
     }
     return parent::beforeDelete();
 }
Example #5
0
 public function beforeDelete()
 {
     if (file_exists($this->urlPath)) {
         unlink($this->urlPath);
     }
     return parent::beforeDelete();
 }
Example #6
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         return unlink($this->filePath . '/' . $this->fileName);
     }
     return false;
 }
Example #7
0
 public function beforeDelete()
 {
     foreach ($this->attachments as $attachment) {
         $attachment->delete();
     }
     return parent::beforeDelete();
 }
Example #8
0
 public function beforeDelete()
 {
     foreach ($this->object->objectTags as $objectTag) {
         $objectTag->delete();
     }
     return parent::beforeDelete();
 }
 public function beforeDelete()
 {
     if (!$this->shift->team->event->active) {
         return false;
     }
     return parent::beforeDelete();
 }
Example #10
0
 public function beforeDelete()
 {
     $ret = parent::beforeDelete();
     // Remove field values
     $this->getDb()->createCommand()->delete(TourFieldValue::tableName(), ['field_id' => $this->id])->execute();
     return $ret;
 }
Example #11
0
 public function beforeDelete()
 {
     if (!parent::beforeDelete()) {
         return false;
     }
     $this->deleteFilename = $this->filename;
     return true;
 }
Example #12
0
 public function beforeDelete()
 {
     if (unlink(\Yii::getAlias('@webroot') . '/' . Yii::$app->params['uploadPath'] . $this->avatar) && unlink(\Yii::getAlias('@webroot') . '/' . Yii::$app->params['uploadPreviewPath'] . $this->avatar)) {
         return parent::beforeDelete();
     } else {
         return false;
     }
 }
Example #13
0
 public function beforeDelete()
 {
     $file = $this->getImagePath() . $this->file;
     if (file_exists($file) && !is_dir($file)) {
         unlink($file);
     }
     return parent::beforeDelete();
 }
Example #14
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         $this->deletePreview();
         return TRUE;
     }
     return FALSE;
 }
Example #15
0
 public function beforeDelete()
 {
     if (!parent::beforeDelete()) {
         return false;
     }
     Settings::deleteDocument();
     return true;
 }
Example #16
0
 public function beforeDelete()
 {
     $res = parent::beforeDelete();
     if ($res) {
         EntityModel::deleteAll(["id" => $this->id]);
     }
     return $res;
 }
Example #17
0
 public function beforeDelete()
 {
     //var_dump($this->getImagepath());die;
     if (file_exists($this->getImagepath())) {
         unlink($this->getImagepath());
     }
     return parent::beforeDelete();
 }
Example #18
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         return unlink($this->filePath);
     } else {
         return false;
     }
 }
Example #19
0
 public function beforeDelete()
 {
     foreach ($this->tagUserAccesses as $item) {
         $item->delete();
     }
     ObjectTag::deleteAll(['tag_id' => $this->id]);
     return parent::beforeDelete();
 }
Example #20
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();
 }
Example #21
0
 public function beforeDelete()
 {
     $filePath = \Yii::getAlias(self::FILE_DIR) . '/' . $this->name;
     if (is_readable($filePath)) {
         unlink($filePath);
     }
     return parent::beforeDelete();
 }
Example #22
0
 public function beforeDelete()
 {
     \Yii::$app->cache->delete('shippings');
     if (parent::beforeDelete()) {
         return true;
     } else {
         return false;
     }
 }
Example #23
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         ExerciseTest::deleteAll(['exercise_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }
 public function beforeDelete()
 {
     \Yii::$app->cache->delete('product_' . $this->idProduct);
     if (parent::beforeDelete()) {
         return true;
     } else {
         return false;
     }
 }
Example #25
0
 /**
  * Delete translated params.
  */
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         SkillsLang::deleteAll(['skill_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }
 /**
  * Delete translated params.
  */
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         ProjectsLang::deleteAll(['project_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }
Example #27
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         TourFields::deleteAll(['tour_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }
Example #28
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         PostDetail::deleteAll(['post_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }
Example #29
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         Tag::updateAllCounters(['frequency' => -1], ['id' => $this->getBookTags()->select(['id'])->asArray()->all()]);
         return true;
     } else {
         return false;
     }
 }
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         ShortLinksClick::deleteAll(['short_links_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }