/**
  * 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);
     }
 }
Ejemplo n.º 2
0
 /**
  * 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));
     }
 }
Ejemplo n.º 3
0
 protected function Delete()
 {
     $this->tree->Remove($this->item);
 }