src/Entity/FormService.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Interfaces\CRMLead;
  4. use App\Repository\FormServiceRepository;
  5. use App\Service\CRM\Lead;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FormServiceRepository::class)
  10.  */
  11. class FormService extends BaseForm implements CRMLead
  12. {
  13.     /**
  14.      * @ORM\Column(type="string")
  15.      * @Assert\Length(max="255")
  16.      * @Assert\NotBlank()
  17.      */
  18.     private $document;
  19.     /**
  20.      * @ORM\Column(type="string")
  21.      * @Assert\Length(max="255")
  22.      * @Assert\NotBlank()
  23.      */
  24.     private $company;
  25.     /**
  26.      * @ORM\Column(type="string")
  27.      * @Assert\Length(max="255")
  28.      * @Assert\NotBlank()
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\Column(type="string")
  33.      * @Assert\Length(max="255")
  34.      * @Assert\NotBlank()
  35.      */
  36.     private $last_name;
  37.     /**
  38.      * @ORM\Column(type="string")
  39.      * @Assert\Length(max="255")
  40.      * @Assert\NotBlank()
  41.      */
  42.     private $email;
  43.     /**
  44.      * @ORM\Column(type="string")
  45.      * @Assert\Length(max="255")
  46.      * @Assert\NotBlank()
  47.      */
  48.     private $phone;
  49.     /**
  50.      * @ORM\Column(type="string")
  51.      * @Assert\Length(max="255")
  52.      * @Assert\NotBlank()
  53.      */
  54.     private $establishment;
  55.     /**
  56.      * @ORM\Column(type="string")
  57.      * @Assert\Length(max="255")
  58.      * @Assert\NotBlank()
  59.      */
  60.     private $service;
  61.     /**
  62.      * @ORM\Column(type="json", nullable=true)
  63.      */
  64.     private $crm_body;
  65.     /**
  66.      * @ORM\Column(type="json", nullable=true)
  67.      */
  68.     private $crm_result;
  69.     /**
  70.      * FormService constructor.
  71.      */
  72.     public function __construct()
  73.     {
  74.         parent::__construct();
  75.     }
  76.     public function getModel(): ?string
  77.     {
  78.         return null;
  79.     }
  80.     public function getCrmModel(): ?string
  81.     {
  82.         return null;
  83.     }
  84.     public function getDepartment(): ?string
  85.     {
  86.         return null;
  87.     }
  88.     public function leadToCRM(): Lead
  89.     {
  90.         $lead = new Lead();
  91.         $lead
  92.             ->setDocumentNumber($this->getDocument())
  93.             ->setCompany($this->getCompany())
  94.             ->setName($this->getName())
  95.             ->setLastname($this->getLastName())
  96.             ->setEmail($this->getEmail())
  97.             ->setPhone($this->getPhone())
  98.             ->setDepartment($this->getDepartment())
  99.             ->setTopic('Cotización')
  100.             ->setCategory('Postventa')
  101.             ->setOriginForm('UD Trucks Postventa')
  102.             ->setUtmSource($this->getUtmSource())
  103.             ->setUtmCampaign($this->getUtmCampaign())
  104.             ->setUtmTerm($this->getUtmTerm())
  105.             ->setUtmMedium($this->getUtmMedium());
  106.         return $lead;
  107.     }
  108.     public function getDocument(): ?string
  109.     {
  110.         return $this->document;
  111.     }
  112.     public function setDocument(string $document): self
  113.     {
  114.         $this->document $document;
  115.         return $this;
  116.     }
  117.     public function getCompany(): ?string
  118.     {
  119.         return $this->company;
  120.     }
  121.     public function setCompany(string $company): self
  122.     {
  123.         $this->company $company;
  124.         return $this;
  125.     }
  126.     public function getName(): ?string
  127.     {
  128.         return $this->name;
  129.     }
  130.     public function setName(string $name): self
  131.     {
  132.         $this->name $name;
  133.         return $this;
  134.     }
  135.     public function getLastName(): ?string
  136.     {
  137.         return $this->last_name;
  138.     }
  139.     public function setLastName(string $last_name): self
  140.     {
  141.         $this->last_name $last_name;
  142.         return $this;
  143.     }
  144.     public function getEmail(): ?string
  145.     {
  146.         return $this->email;
  147.     }
  148.     public function setEmail(string $email): self
  149.     {
  150.         $this->email $email;
  151.         return $this;
  152.     }
  153.     public function getPhone(): ?string
  154.     {
  155.         return $this->phone;
  156.     }
  157.     public function setPhone(string $phone): self
  158.     {
  159.         $this->phone $phone;
  160.         return $this;
  161.     }
  162.     public function getEstablishment(): ?string
  163.     {
  164.         return $this->establishment;
  165.     }
  166.     public function setEstablishment(string $establishment): self
  167.     {
  168.         $this->establishment $establishment;
  169.         return $this;
  170.     }
  171.     public function getService(): ?string
  172.     {
  173.         return $this->service;
  174.     }
  175.     public function setService(string $service): self
  176.     {
  177.         $this->service $service;
  178.         return $this;
  179.     }
  180.     public function getCrmBody(): ?array
  181.     {
  182.         return $this->crm_body;
  183.     }
  184.     public function setCrmBody(?array $crm_body): self
  185.     {
  186.         $this->crm_body $crm_body;
  187.         return $this;
  188.     }
  189.     public function getCrmResult(): ?array
  190.     {
  191.         return $this->crm_result;
  192.     }
  193.     public function setCrmResult(?array $crm_result): self
  194.     {
  195.         $this->crm_result $crm_result;
  196.         return $this;
  197.     }
  198. }