user->getId(); $searchParams = $this->searchParamsFetcher->fetch($request); $offset = $searchParams->getOffset(); $maxSize = $searchParams->getMaxSize(); $after = $request->getQueryParam('after'); $params = [ 'offset' => $offset, 'maxSize' => $maxSize, 'after' => $after, ]; $recordCollection = $this->getNotificationService()->getList($userId, $params); return (object) [ 'total' => $recordCollection->getTotal(), 'list' => $recordCollection->getValueMapList(), ]; } public function getActionNotReadCount(): int { $userId = $this->user->getId(); return $this->getNotificationService()->getNotReadCount($userId); } public function postActionMarkAllRead(Request $request): bool { $userId = $this->user->getId(); $this->getNotificationService()->markAllRead($userId); return true; } private function getNotificationService(): Service { /** @var Service */ return $this->recordServiceContainer->get('Notification'); } }