コード例 #1
0
ファイル: Page.php プロジェクト: ngocanh/pimcore
 /**
  * @see Document::delete and Document_PageSnippet::delete
  * @return void
  */
 public function delete()
 {
     if ($this->getId() == 1) {
         throw new Exception("root-node cannot be deleted");
     }
     parent::delete();
 }
コード例 #2
0
ファイル: Page.php プロジェクト: shanky0110/pimcore-custom
 /**
  * @see Document::delete and Document_PageSnippet::delete
  * @return void
  */
 public function delete()
 {
     if ($this->getId() == 1) {
         throw new Exception("root-node cannot be deleted");
     }
     // check for redirects pointing to this document, and delete them too
     $redirects = new Redirect_List();
     $redirects->setCondition("target = ?", $this->getId());
     $redirects->load();
     foreach ($redirects->getRedirects() as $redirect) {
         $redirect->delete();
     }
     parent::delete();
 }