Пример #1
0
 /**
  * {@inheritdoc}
  * @see \Scalr\Model\AbstractEntity::delete()
  */
 public function delete()
 {
     if ($this->checkRemoval()) {
         //Completely remove it
         parent::delete();
         ReportEntity::deleteBy([['subjectId' => $this->projectId], ['subjectType' => ReportEntity::SUBJECT_TYPE_PROJECT]]);
         NotificationEntity::deleteBy([['subjectId' => $this->projectId], ['subjectType' => NotificationEntity::SUBJECT_TYPE_PROJECT]]);
     } else {
         //Archive it
         $this->archived = true;
         $this->save();
     }
 }