Exemplo n.º 1
0
 /**
  * Reports a content action with dependencies to the log
  * @param Content $content The content being manipulated
  * @param Enums\Action $action The operation executed on the content
  */
 function ReportContentAction(Content $content, Enums\Action $action)
 {
     $logItem = $this->CreateLogItem(Enums\ObjectType::Content(), $action);
     if (!$action->Equals(Enums\Action::Delete())) {
         $logContent = new LogContent();
         $logContent->SetLogItem($logItem);
         $logContent->SetContent($content);
         $logContent->Save();
     } else {
         if ($content->GetContainerContent()) {
             $this->ReportContainerAction($content->GetContainerContent()->GetContainer(), Enums\Action::ChildDelete());
         } else {
             if ($content->GetPageContent()) {
                 $this->ReportPageAction($content->GetPageContent()->GetPage(), Enums\Action::ChildDelete());
             } else {
                 if ($content->GetLayoutContent()) {
                     $this->ReportAreaAction($content->GetLayoutContent()->GetArea(), Enums\Action::ChildDelete());
                 }
             }
         }
     }
 }