/** * @param Response $response * @param array $certificationList */ protected function addCertification(Response $response, array $certificationList) { foreach ($certificationList as $certification) { $certification = $this->certificationRepository->findOneBy(array('name' => trim($certification))); if (!$certification instanceof Certification) { continue; } $response->addCertification($certification); } }