[BUGFIX] Remove deprecated annotation usage in sys_note
[Packages/TYPO3.CMS.git] / typo3 / sysext / sys_note / Classes / Controller / NoteController.php
1 <?php
2 namespace TYPO3\CMS\SysNote\Controller;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Note controller
19 */
20 class NoteController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
21 {
22 /**
23 * @var \TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository
24 */
25 protected $sysNoteRepository;
26
27 /**
28 * @param \TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository $sysNoteRepository
29 */
30 public function injectSysNoteRepository(\TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository $sysNoteRepository)
31 {
32 $this->sysNoteRepository = $sysNoteRepository;
33 }
34
35 /**
36 * Render notes by single PID or PID list
37 *
38 * @param string $pids Single PID or comma separated list of PIDs
39 * @return string
40 */
41 public function listAction($pids)
42 {
43 if (empty($pids) || empty($GLOBALS['BE_USER']->user['uid'])) {
44 return '';
45 }
46 $notes = $this->sysNoteRepository->findByPidsAndAuthorId($pids, $GLOBALS['BE_USER']->user['uid']);
47 $this->view->assign('notes', $notes);
48 }
49 }