本文整理汇总了PHP中Pimcore\Model\Document::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Document::delete方法的具体用法?PHP Document::delete怎么用?PHP Document::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Model\Document
的用法示例。
在下文中一共展示了Document::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* @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: delete
/**
* @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();
}