| 1 | <?php |
||
| 5 | class NewsController extends CRUDController |
||
| 6 | { |
||
| 7 | public function showAction(News $article) |
||
| 11 | |||
| 12 | public function listAction(Request $request, NewsCategory $category = null) |
||
|
|
|||
| 13 | { |
||
| 14 | $qb = $this->getQueryBuilder(); |
||
| 15 | |||
| 16 | $currentPage = $this->getCurrentPage(); |
||
| 17 | |||
| 18 | $news = $qb->sortBy('created')->reverse() |
||
| 19 | ->where('category')->is($category) |
||
| 20 | ->limit(5)->fromPage($currentPage) |
||
| 21 | ->getModels(); |
||
| 22 | |||
| 23 | return array( |
||
| 24 | "news" => $news, |
||
| 25 | "categories" => $this->getCategories(), |
||
| 26 | "category" => $category, |
||
| 27 | "currentPage" => $currentPage, |
||
| 28 | "totalPages" => $qb->countPages() |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function createAction(Player $me) |
||
| 36 | |||
| 37 | public function editAction(Player $me, News $article) |
||
| 41 | |||
| 42 | public function deleteAction(Player $me, News $article) |
||
| 46 | |||
| 47 | private function getCategories() |
||
| 53 | } |
||
| 54 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.