示例#1
0
 public function BackendName()
 {
     $result = 'container';
     if (!$this->content) {
         return $result;
     }
     $contContainer = ContentContainer::Schema()->ByContent($this->content);
     $result = '« ' . $contContainer->GetContainer()->GetName() . ' »';
     return $result;
 }
 /**
  * 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));
     }
 }
 /**
  * Sets the specific container and returns the content element
  * @return ContentContainer
  */
 protected function SaveElement()
 {
     $this->container->SetContainer(new Container($this->Value('Container')));
     return $this->container;
 }
 /**
  * Gets a container referenced by a content
  * @param Content $content The content
  * @return Container Returns The referenced container, if exists
  */
 public function GetReferencedContainer(Content $content)
 {
     $contentContainer = ContentContainer::Schema()->ByContent($content);
     return $contentContainer ? $contentContainer->GetContainer() : null;
 }