public function delete() { if (!$this->isNoDeleteEnabled()) { return parent::delete(); } if (!$this->deleteAllDescendants()) { static::raiseError(__CLASS__ . '::deleteAllDescendants() returned false!'); return false; } if (!$this->setDeleted(true)) { static::raiseError(__CLASS__ . '::setDeleted() returned false!'); return false; } if (!$this->save()) { static::raiseError(__CLASS__ . '::save() returned false!'); return false; } return true; }