/** * Deletes the navi items related to the page * @param Page $item The page to be deleted */ public function BeforeDelete($item) { $navPages = NavigationPage::Schema()->FetchByPage(false, $item); foreach ($navPages as $navPage) { $item = $navPage->GetItem(); $tree = new TreeBuilder(new NavigationTreeProvider($item->GetNavigation())); $tree->Remove($item); } }
/** * Deletes the container contents related to the container * @param Container $item The container to be deleted */ public function BeforeDelete($item) { $contContainers = ContentContainer::Schema()->FetchByContainer(true, $item); $logger = new Logger(BackendModule::Guard()->GetUser()); foreach ($contContainers as $contContainer) { $content = $contContainer->GetContent(); $provider = ContentTreeUtil::GetTreeProvider($content); $tree = new TreeBuilder($provider); $logger->ReportContentAction($content, Action::Delete()); $tree->Remove($provider->ItemByContent($content)); } }
protected function Delete() { $this->tree->Remove($this->item); }