fieldModel = $fieldModel; $this->fieldsWithUniqueIdentifier = $fieldsWithUniqueIdentifier; $this->object = 'company'; } /** * @return Company[] * * @throws UniqueFieldNotFoundException */ public function checkForDuplicateCompanies(array $queryFields): array { $uniqueData = $this->getUniqueData($queryFields); if (empty($uniqueData)) { throw new UniqueFieldNotFoundException(); } return $this->companyRepository->getCompaniesByUniqueFields($uniqueData); } }