Ejemplo n.º 1
0
 /**
  * 加载原型中的所有分类,
  * 返回的迭代器的元素中不包含他们之间的关系,如果需要分类间的关系,使用本类的buildTree方法
  * @return Model
  */
 public static function load(Model $aModelList)
 {
     $aCriteria = clone $aModelList->prototype()->criteria();
     $aCriteria->addOrderBy('lft', false);
     if (!$aModelList->load($aCriteria)) {
         return new \EmptyIterator();
     }
     return $aModelList;
 }