/** * Render notes by single PID or PID list * * @param string $pids Single PID or comma separated list of PIDs * @return string * @dontvalidate $pids */ public function listAction($pids) { if (empty($pids) || empty($GLOBALS['BE_USER']->user['uid'])) { return ''; } $author = $this->backendUserRepository->findByUid($GLOBALS['BE_USER']->user['uid']); $notes = $this->sysNoteRepository->findByPidsAndAuthor($pids, $author); $this->view->assign('notes', $notes); }
/** * Resolve user name from backend user id. * * @param integer $uid Uid of the user * @return string Username or an empty string if there is no user with that UID */ public function render($uid) { /** @var $user \TYPO3\CMS\Extbase\Domain\Model\BackendUser */ $user = $this->backendUserRepository->findByUid($uid); if ($user === NULL) { return ''; } return $user->getUserName(); }
/** * Resolve user name from backend user id. * * @param integer $uid Uid of the user * @return string Username or an empty string if there is no user with that UID */ public function render($uid) { if (isset(static::$usernameRuntimeCache[$uid])) { return static::$usernameRuntimeCache[$uid]; } /** @var $user \TYPO3\CMS\Extbase\Domain\Model\BackendUser */ $user = $this->backendUserRepository->findByUid($uid); // $user may be NULL if user was deleted from DB, set it to empty string to always return a string static::$usernameRuntimeCache[$uid] = $user === NULL ? '' : $user->getUserName(); return static::$usernameRuntimeCache[$uid]; }