1 | <?php |
||
9 | class CategoryController extends AbstractActionController |
||
10 | { |
||
11 | protected $catalogService; |
||
12 | |||
13 | public function indexAction() |
||
14 | { |
||
15 | $paginatorVars = $this->getPaginatorVars(); |
||
16 | |||
17 | $id = $this->params('id'); |
||
18 | $service = $this->getServiceLocator()->get('speckcatalog_category_service'); |
||
19 | $category = $service->getCategoryForView($id, $paginatorVars); |
||
20 | |||
21 | $crumbs = $service->getCrumbs($category); |
||
22 | $this->layout()->crumbs = array( |
||
23 | 'type' => 'category', |
||
24 | 'crumbs' => $crumbs, |
||
25 | ); |
||
26 | |||
27 | if (null === $category) { |
||
28 | throw new \Exception('fore oh fore'); |
||
29 | } |
||
30 | |||
31 | $paginatorVars['categoryId'] = $category->getCategoryId(); |
||
32 | |||
33 | return new ViewModel(array( |
||
34 | 'category' => $category, |
||
35 | 'paginatorVars' => $paginatorVars, |
||
36 | )); |
||
37 | } |
||
38 | |||
39 | public function setCatalogService($catalogService) |
||
43 | |||
44 | public function getCatalogService() |
||
48 | |||
49 | public function getPaginatorVars($stringify = false) |
||
64 | |||
65 | public function perPageAction() |
||
86 | } |
||
87 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.