getContainer()->getPermissionsService()->currentUserCanRead(Entities::NOTIFICATIONS)) { throw new AccessDeniedException('You are not allowed to read notifications'); } $result = new CommandResult(); /** @var NotificationSMSHistoryRepository $notificationsSMSHistoryRepo */ $notificationsSMSHistoryRepo = $this->container->get('domain.notificationSMSHistory.repository'); /** @var SettingsService $settingsService */ $settingsService = $this->container->get('domain.settings.service'); $itemsPerPage = $settingsService->getSetting('general', 'itemsPerPage'); $params = $command->getField('params'); $notifications = $notificationsSMSHistoryRepo->getFiltered($params, $itemsPerPage); $result->setResult(CommandResult::RESULT_SUCCESS); $result->setMessage('Successfully retrieved notifications.'); $result->setData([ Entities::NOTIFICATIONS => $notifications, 'countFiltered' => (int)$notificationsSMSHistoryRepo->getCount($params) ]); return $result; } }