delete() public method

Deletes the document
public delete ( ) : void
return void
示例#1
0
文件: Hardlink.php 项目: sfie/pimcore
 /**
  * @see Document::delete
  * @return void
  */
 public function delete()
 {
     // hardlinks cannot have direct children in "real" world, so we have to empty them before we delete it
     $this->childs = [];
     // check for redirects pointing to this document, and delete them too
     $redirects = new Redirect\Listing();
     $redirects->setCondition("target = ?", $this->getId());
     $redirects->load();
     foreach ($redirects->getRedirects() as $redirect) {
         $redirect->delete();
     }
     parent::delete();
     // we re-enable the children functionality by setting them to NULL, if requested they'll be loaded again
     // -> see $this->getChilds() , doesn't make sense when deleting an item but who knows, ... ;-)
     $this->childs = null;
 }
示例#2
0
 /**
  * @see Document::delete
  * @return void
  */
 public function delete()
 {
     $versions = $this->getVersions();
     foreach ($versions as $version) {
         $version->delete();
     }
     // remove all tasks
     $this->getDao()->deleteAllTasks();
     parent::delete();
 }