| Conditions | 5 |
| Paths | 9 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 3 | public function indexAction(): void |
|
| 19 | { |
||
| 20 | // By default we show overall activity |
||
| 21 | 3 | $item = null; |
|
| 22 | 3 | $this->view->title = $this->view->translate('Overall activity'); |
|
| 23 | |||
| 24 | // Try to show user's actitvity |
||
| 25 | 3 | if ($this->getRequest()->getParam('user')) { |
|
| 26 | 1 | $item = \mQueue\Model\UserMapper::find($this->getRequest()->getParam('user')); |
|
| 27 | 1 | if ($item) { |
|
| 28 | 1 | $this->view->title = $this->view->translate('Activity for %s', [$item->nickname]); |
|
|
|
|||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | // Try to show movie's actitvity |
||
| 33 | 3 | if ($this->getRequest()->getParam('movie')) { |
|
| 34 | 1 | $item = \mQueue\Model\MovieMapper::find($this->getRequest()->getParam('movie')); |
|
| 35 | 1 | if ($item) { |
|
| 36 | 1 | $this->view->title = $this->view->translate('Activity for %s', [$item->getTitle()]); |
|
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | 3 | $this->view->activity = $this->_helper->createPaginator(\mQueue\Model\StatusMapper::getActivityQuery($item)); |
|
| 41 | 3 | } |
|
| 43 |