private function processSingleCenterInstitution() { $firstMedicalCenter = isset($this->institution['institutionMedicalCenters'][0]) ? $this->institution['institutionMedicalCenters'][0] : null; if (!$firstMedicalCenter) { // FIXME: no medical center, right now throw an exception since this should not happen throw $this->createNotFoundException('Invalid single center clinic'); } $this->apiInstitutionMedicalCenterService->buildInstitutionSpecializations($firstMedicalCenter)->buildBusinessHours($firstMedicalCenter)->buildDoctors($firstMedicalCenter); // build doctors from first clinic $this->institution['doctors'] = $firstMedicalCenter['doctors']; $this->institution['institutionMedicalCenters'][0] = $firstMedicalCenter; }