/**
  * @param ParameterBag $params
  *
  * @return Appointment
  */
 public function create($params)
 {
     $entity = new Appointment();
     $entity->setClient($params->get('client'));
     $entity->setDateTime($params->get('dateTime'));
     $entity->setDuration($params->get('duration'));
     $entity->setOffice($params->get('office'));
     $entity->setDescription($params->get('description'));
     $entity->setService($params->get('service'));
     $entity->setState($params->get('state', Appointment::STATE_NEW));
     $entity->setUser($params->get('user'));
     $this->persist($entity);
     return $entity;
 }