コード例 #1
0
ファイル: ItemManager.php プロジェクト: bono-cms/Menu
 /**
  * Fetch all items associated with given category id
  * 
  * @param string $categoryId
  * @param boolean $published Whether to filter by published attribute
  * @return array
  */
 public function fetchAllByCategoryId($categoryId, $published)
 {
     return $this->itemMapper->fetchAllByCategoryId($categoryId, $published);
 }
コード例 #2
0
ファイル: SiteService.php プロジェクト: bono-cms/Menu
 /**
  * Returns a tree builder loaded with provided menu class
  * 
  * @param string $class Menu category's class
  * @return \Krystal\Tree\AdjacencyList\TreeBuilder
  */
 private function createTreeBuilder($class)
 {
     $id = $this->categoryMapper->fetchIdByClass($class);
     $data = $this->itemMapper->fetchAllByCategoryId($id, true);
     return new TreeBuilder($data);
 }