Beispiel #1
0
 /**
  * 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);
 }
Beispiel #2
0
 /**
  * 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);
 }