/**
  * Gets the top most content of the container
  * @return ContainerContent The first and root container content
  */
 function TopMost()
 {
     $sql = Access::SqlBuilder();
     $tbl = ContainerContent::Schema()->Table();
     $where = $sql->Equals($tbl->Field('Container'), $sql->Value($this->container->GetID()))->And_($sql->IsNull($tbl->Field('Parent')))->And_($sql->IsNull($tbl->Field('Previous')));
     return ContainerContent::Schema()->First($where);
 }
 /**
  * The edit/create url base parameters
  * @return array Returns the parameters for creating/editing
  */
 protected function EditParams()
 {
     $params = array();
     $params['container'] = $this->container->GetID();
     return $params;
 }
 protected function CreateFormUrl()
 {
     $args = array('container' => $this->container->GetID());
     return BackendRouter::ModuleUrl(new ModuleForm(), $args);
 }
Пример #4
0
 /**
  * The url to the content tree of the container
  * @param Container $container
  * @return string
  */
 protected function ContentTreeUrl(Container $container)
 {
     return BackendRouter::ModuleUrl(new ContainerContentTree(), array('container' => $container->GetID()));
 }
Пример #5
0
 /**
  * The last log item that is directly related to the container
  * @param Container $container The container
  * @return LogItem Returns the log item
  */
 static function LastContainerLog(Container $container)
 {
     $tblLogContainer = LogContainer::Schema()->Table();
     $tblLogItem = LogItem::Schema()->Table();
     $sql = Access::SqlBuilder();
     $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
     $joinCond = $sql->Equals($tblLogContainer->Field('LogItem'), $tblLogItem->Field('ID'));
     $where = $sql->Equals($tblLogContainer->Field('Container'), $sql->Value($container->GetID()));
     return LogItem::Schema()->First($where, $orderBy, null, $sql->Join($tblLogContainer), JoinType::Inner(), $joinCond);
 }