Esempio n. 1
0
 public function registraContacto(ContactoDTO $to)
 {
     $contacto = new Contacto($to->getId());
     $contacto->setNombre($to->getNombre());
     $contacto->setApellido($to->getApellido());
     $contacto->setTelefono($to->getTelefono());
     $contacto->setAsunto($to->getAsunto());
     $contacto->setMensaje($to->getMensaje());
     $contacto;
     try {
         $this->em->persist($contacto);
         $this->em->flush();
     } catch (ORMInvalidArgumentException $exc) {
         echo '<pre>';
         print_r($exc->getTraceAsString());
     } catch (\Doctrine\ORM\ORMException $exc) {
         echo '<pre>';
         print_r($exc->getTraceAsString());
         echo '<pre>';
         print_r($exc->getTrace());
     } catch (Exception $e) {
         echo '<pre>';
         print_r($e->getTraceAsString());
     }
     //return $contacto->getIdContact();
 }
Esempio n. 2
0
 public function createCallSugar(ContactoDTO $to)
 {
     $calls = new Calls(Utils::createIdSugar());
     $calls->setName($to->getAsunto());
     $calls->setDateEntered(Utils::getCurrentDateAndTime());
     $calls->setDateModified(Utils::getCurrentDateAndTime());
     $calls->setModifiedUserId('1');
     $calls->setCreatedBy('1');
     $calls->setDescription($to->getMensaje());
     $calls->setDeleted(FALSE);
     $calls->setAssignedUserId('1');
     $calls->setDurationHours(0);
     $calls->setDurationMinutes(15);
     $calls->setDateStart(Utils::calculateCallDateStart());
     $calls->setDateEnd(Utils::calculateCallDateEnd());
     $calls->setParentType('Contacts');
     $calls->setStatus('Planned');
     $calls->setDirection('outbound');
     $calls->setParentId($to->getId());
     $calls->setReminderTime(1800);
     $calls->setEmailReminderTime(-1);
     $calls->setEmailReminderSent(FALSE);
     $calls->setRepeatInterval(1);
     try {
         $this->em->persist($calls);
         $this->em->flush();
     } catch (Exception $e) {
     }
     return $calls->getId();
 }