Пример #1
0
 /**
  * getter na potomky, ktere budou v prvni urovni prispevku serazeny sestupne
  * @return DiscussionsRecords
  */
 public function getChildren()
 {
     try {
         if ($this->children instanceof AbstractRecords || $this->records instanceof LBoxPagingIterator) {
             return $this->children;
         }
         $treeColNames = $this->getClassVar("treeColNames");
         $parentId = NULL;
         foreach (LBoxFront::getUrlParamsArray() as $param) {
             if (preg_match("/" . $this->patternURLParamReplyTo . "/", $param, $matches)) {
                 $parentId = $matches[1];
             }
         }
         if (!$this->hasParent() && $parentId) {
             // replyto
             $this->children = new DiscussionsRecordsNotTree(array($this->getClassVar("idColName") => $parentId));
             $this->children->setOutputFilterItemsClass("OutputFilterDiscussionRecord");
         } else {
             // strankovany vypis z rootu
             if (!$this->hasParent() && is_numeric($pageItems = LBoxConfigManagerProperties::gpcn("discussion_paging_pageitems")) && $pageItems > 0) {
                 $this->children = new LBoxPagingIteratorRecords("DiscussionsRecordsNotTree", $pageItems, get_class($this->outputFilter), array($treeColNames[2] => $this->getParamDirect($this->getClassVar("idColName"))), array($treeColNames[0] => 0));
             } else {
                 $this->children = parent::getChildren(false, $this->hasParent() ? array($treeColNames[0] => 1) : array($treeColNames[0] => 0));
             }
         }
         return $this->children;
     } catch (Exception $e) {
         throw $e;
     }
 }