コード例 #1
0
ファイル: Category.php プロジェクト: saiber/www
 /**
  * Loads a set of Category active records
  *
  * @param ARSelectFilter $filter
  * @param bool $loadReferencedRecords
  *
  * @return ARSet
  */
 public static function getRecordSet(ARSelectFilter $filter, $loadReferencedRecords = false)
 {
     return parent::getRecordSet(__CLASS__, $filter, $loadReferencedRecords);
 }
コード例 #2
0
ファイル: ActiveTreeNode.php プロジェクト: saiber/www
 /**
  * Gets a hierarchial path to a given tree node
  *
  * The result is a sequence of record starting from a root node
  * E.x. Consider a tree branch: Electronics -> Computers -> Laptops
  * The path of "Laptops" will be a record set (ARSet) with a following order of records:
  * 1. Electronics
  * 2. Computers
  *
  * @param bool $includeRootNode
  * @param bool $loadReferencedRecords
  * @return ARSet
  *
  * @see ARSet
  */
 public function getPathNodeSet($includeRootNode = false, $loadReferencedRecords = false)
 {
     $className = get_class($this);
     // cache data if referenced records are not being loaded
     if (!$loadReferencedRecords) {
         if (!$this->pathNodes) {
             $this->pathNodes = ActiveTreeNode::getRecordSet($className, $this->getPathNodeFilter(true), false);
         }
         $nodeSet = clone $this->pathNodes;
         if (!$includeRootNode) {
             $nodeSet->remove(0);
         }
         return $nodeSet;
     } else {
         return ActiveTreeNode::getRecordSet($className, $this->getPathNodeFilter($includeRootNode), $loadReferencedRecords);
     }
 }