Exemple #1
0
 /**
  * @param \ConsultBundle\Entity\DoctorConsultSettings $doctorConsultSettings
  *
  * @return \ConsultBundle\Entity\DoctorEntity|null
  */
 public static function getEntityFromConsultSettings(DoctorConsultSettings $doctorConsultSettings)
 {
     if (empty($doctorConsultSettings)) {
         return null;
     }
     $doctorEntity = new DoctorEntity();
     $doctorEntity->setName($doctorConsultSettings->getName());
     $doctorEntity->setProfilePicture($doctorConsultSettings->getProfilePicture());
     $doctorEntity->setSpeciality($doctorConsultSettings->getSpeciality());
     $doctorEntity->setFabricId($doctorConsultSettings->getFabricDoctorId());
     $doctorEntity->setActivated($doctorConsultSettings->isActivated());
     return $doctorEntity;
 }
Exemple #2
0
 /**
  * @param \ConsultBundle\Entity\DoctorConsultSettings $doctor
  * @param                                             $requestParams
  *
  * @throws \ConsultBundle\Manager\ValidationError
  */
 private function updateFields(DoctorConsultSettings $doctor, $requestParams)
 {
     $doctor->setAttributes($requestParams);
     try {
         $this->validator->validate($doctor);
     } catch (ValidationError $e) {
         throw new ValidationError($e->getMessage());
     }
     return;
 }