> */ public function actionSearchInAddressBook(Request $request): array { if (!$this->acl->checkScope('Email')) { throw new Forbidden(); } if (!$this->acl->checkScope('Email', 'create')) { throw new Forbidden(); } $q = $request->getQueryParam('q'); if ($q === null) { throw new BadRequest("No `q` parameter."); } $maxSize = intval($request->getQueryParam('maxSize')); if (empty($maxSize) || $maxSize > 50) { $maxSize = $this->config->get('recordsPerPage', 20); } $onlyActual = $request->getQueryParam('onlyActual') === 'true'; return $this->getEmailAddressService()->searchInAddressBook($q, $maxSize, $onlyActual); } private function getEmailAddressService(): Service { /** @var Service */ return $this->getRecordService(); } }