src/Entity/Client.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Constants\Typology;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * Clientes
  9.  *
  10.  * @ORM\Table(name="clients")
  11.  * @ORM\Entity(repositoryClass="App\Repository\ClientRepository")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  */
  14. class Client
  15. {
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="type", type="string", length=255)
  28.      * @Assert\NotBlank()
  29.      */
  30.     private $type;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="name", type="string", length=255)
  35.      * @Assert\NotBlank()
  36.      */
  37.     private $name;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="title", type="string", length=255, nullable=true)
  42.      */
  43.     private $title;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="address", type="string", length=255)
  48.      * @Assert\NotBlank()
  49.      */
  50.     private $address;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="address_number", type="string", length=255)
  55.      * @Assert\NotBlank()
  56.      */
  57.     private $addressNumber;
  58.     /**
  59.      * @var string
  60.      *
  61.      * @ORM\Column(name="zip_code", type="string", length=255)
  62.      * @Assert\NotBlank()
  63.      */
  64.     private $zipCode;
  65.     /**
  66.      * @var string
  67.      *
  68.      * @ORM\Column(name="population", type="string", length=255, nullable=true)
  69.      *
  70.      */
  71.     private $population;
  72.     /**
  73.      * @var string
  74.      *
  75.      * @ORM\Column(name="province", type="string", length=255, nullable=true)
  76.      *
  77.      */
  78.     private $province;
  79.     /**
  80.      * @var string
  81.      *
  82.      * @ORM\Column(name="region", type="string", length=255)
  83.      * @Assert\NotBlank()
  84.      */
  85.     private $region;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(name="country", type="string", length=255)
  90.      * @Assert\NotBlank()
  91.      */
  92.     private $country;
  93.     /**
  94.      * @var string
  95.      *
  96.      * @ORM\Column(name="telephone", type="string", length=255)
  97.      * @Assert\NotBlank()
  98.      */
  99.     private $telephone;
  100.     /**
  101.      * @var string
  102.      *
  103.      * @ORM\Column(name="fax", type="string", length=255, nullable=true)
  104.      *
  105.      */
  106.     private $fax;
  107.     /**
  108.      * @var string
  109.      *
  110.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  111.      */
  112.     private $email;
  113.     /**
  114.      * @var string
  115.      *
  116.      * @ORM\Column(name="gds", type="string", length=255, nullable=true)
  117.      */
  118.     private $gds;
  119.     /**
  120.      * @var string
  121.      *
  122.      * @ORM\Column(name="type_document", type="string", length=255, nullable=true)
  123.      */
  124.     private $typeDocument;
  125.     /**
  126.      * @var string
  127.      *
  128.      * @ORM\Column(name="id_document", type="string", length=255, nullable=true)
  129.      */
  130.     private $idDocument;
  131.     /**
  132.      * @var string
  133.      *
  134.      * @ORM\Column(name="observation", type="text", nullable=true)
  135.      */
  136.     private $observation;
  137.     /**
  138.      * @var int
  139.      *
  140.      * @ORM\Column(name="id_office", type="integer")
  141.      * @Assert\NotBlank()
  142.      */
  143.     private $idOffice;
  144.     /**
  145.      * @var \DateTime
  146.      *
  147.      * @ORM\Column(name="created_at", type="datetime")
  148.      */
  149.     private $createdAt;
  150.     /**
  151.      * @var int
  152.      *
  153.      * @ORM\Column(name="created_id", type="integer", nullable=true)
  154.      */
  155.     private $createdId;
  156.     /**
  157.      * @var \DateTime
  158.      *
  159.      * @ORM\Column(name="updated_at", type="datetime")
  160.      */
  161.     private $updatedAt;
  162.     /**
  163.      * @var int
  164.      *
  165.      * @ORM\Column(name="updated_id", type="integer", nullable=true)
  166.      */
  167.     private $updatedId;
  168.     /**
  169.      * @var int
  170.      *
  171.      * @ORM\Column(name="status", type="boolean")
  172.      */
  173.     private $state;
  174.     /**
  175.      * @var string
  176.      *
  177.      * @ORM\Column(name="picture", type="string", length=255, nullable=true)
  178.      */
  179.     private $picture;
  180.     /**
  181.      * @var string
  182.      *
  183.      * @ORM\Column(name="group_id", type="integer", nullable=true)
  184.      */
  185.     private $groupId;
  186.     /**
  187.      * @var string
  188.      *
  189.      * @ORM\Column(name="competency", type="string", length=255, nullable=true)
  190.      */
  191.     private $competency;
  192.     /**
  193.      * @var string
  194.      *
  195.      * @ORM\Column(name="action", type="string", length=255, nullable=true)
  196.      * @Assert\NotBlank()
  197.      */
  198.     private $action;
  199.     /**
  200.      * @var string
  201.      *
  202.      * @ORM\Column(name="return_investment", type="string", length=255, nullable=true)
  203.      */
  204.     private $returnInvestment;
  205.     /**
  206.      * @var bool
  207.      *
  208.      * @ORM\Column(name="is_client_in_out", type="boolean", nullable=true)
  209.      */
  210.     private $isClientInOut;
  211.     /**
  212.      * @var bool
  213.      *
  214.      * @ORM\Column(name="is_client_green_patio", type="boolean", nullable=true)
  215.      */
  216.     private $isClientGreenPatio;
  217.     /**
  218.      * @var bool
  219.      *
  220.      * @ORM\Column(name="is_client_av_express", type="boolean", nullable=true)
  221.      */
  222.     private $isClientAvExpress;
  223.     /**
  224.      * @var bool
  225.      *
  226.      * @ORM\Column(name="is_client_develup", type="boolean", nullable=true)
  227.      */
  228.     private $isClientDevelup;
  229.     /**
  230.      * @ORM\Column(type="string", length=100, nullable=true)
  231.      */
  232.     private $typology;
  233.     /**
  234.      * Get id
  235.      *
  236.      * @return int
  237.      */
  238.     public function getId()
  239.     {
  240.         return $this->id;
  241.     }
  242.     /**
  243.      * Set type
  244.      *
  245.      * @param string $type
  246.      *
  247.      * @return Client
  248.      */
  249.     public function setType($type)
  250.     {
  251.         $this->type $type;
  252.         return $this;
  253.     }
  254.     /**
  255.      * Get type
  256.      *
  257.      * @return string
  258.      */
  259.     public function getType()
  260.     {
  261.         return $this->type;
  262.     }
  263.     /**
  264.      * Set name
  265.      *
  266.      * @param string $name
  267.      *
  268.      * @return Client
  269.      */
  270.     public function setName($name)
  271.     {
  272.         $this->name $name;
  273.         return $this;
  274.     }
  275.     /**
  276.      * Get name
  277.      *
  278.      * @return string
  279.      */
  280.     public function getName()
  281.     {
  282.         return $this->name;
  283.     }
  284.     /**
  285.      * Set title
  286.      *
  287.      * @param string $title
  288.      *
  289.      * @return Client
  290.      */
  291.     public function setTitle($title)
  292.     {
  293.         $this->title $title;
  294.         return $this;
  295.     }
  296.     /**
  297.      * Get title
  298.      *
  299.      * @return string
  300.      */
  301.     public function getTitle()
  302.     {
  303.         return $this->title;
  304.     }
  305.     /**
  306.      * Set address
  307.      *
  308.      * @param string $address
  309.      *
  310.      * @return Client
  311.      */
  312.     public function setAddress($address)
  313.     {
  314.         $this->address $address;
  315.         return $this;
  316.     }
  317.     /**
  318.      * Get address
  319.      *
  320.      * @return string
  321.      */
  322.     public function getAddress()
  323.     {
  324.         return $this->address;
  325.     }
  326.     /**
  327.      * Set addressNumber
  328.      *
  329.      * @param string $addressNumber
  330.      *
  331.      * @return Client
  332.      */
  333.     public function setAddressNumber($addressNumber)
  334.     {
  335.         $this->addressNumber $addressNumber;
  336.         return $this;
  337.     }
  338.     /**
  339.      * Get addressNumber
  340.      *
  341.      * @return string
  342.      */
  343.     public function getAddressNumber()
  344.     {
  345.         return $this->addressNumber;
  346.     }
  347.     /**
  348.      * Set zipCode
  349.      *
  350.      * @param string $zipCode
  351.      *
  352.      * @return Client
  353.      */
  354.     public function setZipCode($zipCode)
  355.     {
  356.         $this->zipCode $zipCode;
  357.         return $this;
  358.     }
  359.     /**
  360.      * Get zipCode
  361.      *
  362.      * @return string
  363.      */
  364.     public function getZipCode()
  365.     {
  366.         return $this->zipCode;
  367.     }
  368.     /**
  369.      * Set population
  370.      *
  371.      * @param string $population
  372.      *
  373.      * @return Client
  374.      */
  375.     public function setPopulation($population)
  376.     {
  377.         $this->population $population;
  378.         return $this;
  379.     }
  380.     /**
  381.      * Get population
  382.      *
  383.      * @return string
  384.      */
  385.     public function getPopulation()
  386.     {
  387.         return $this->population;
  388.     }
  389.     /**
  390.      * Set province
  391.      *
  392.      * @param string $province
  393.      *
  394.      * @return Client
  395.      */
  396.     public function setProvince($province)
  397.     {
  398.         $this->province $province;
  399.         return $this;
  400.     }
  401.     /**
  402.      * Get province
  403.      *
  404.      * @return string
  405.      */
  406.     public function getProvince()
  407.     {
  408.         return $this->province;
  409.     }
  410.     /**
  411.      * Set country
  412.      *
  413.      * @param string $country
  414.      *
  415.      * @return Client
  416.      */
  417.     public function setCountry($country)
  418.     {
  419.         $this->country $country;
  420.         return $this;
  421.     }
  422.     /**
  423.      * Get country
  424.      *
  425.      * @return string
  426.      */
  427.     public function getCountry()
  428.     {
  429.         return $this->country;
  430.     }
  431.     /**
  432.      * Set telephone
  433.      *
  434.      * @param string $telephone
  435.      *
  436.      * @return Client
  437.      */
  438.     public function setTelephone($telephone)
  439.     {
  440.         $this->telephone $telephone;
  441.         return $this;
  442.     }
  443.     /**
  444.      * Get telephone
  445.      *
  446.      * @return string
  447.      */
  448.     public function getTelephone()
  449.     {
  450.         return $this->telephone;
  451.     }
  452.     /**
  453.      * Set fax
  454.      *
  455.      * @param string $fax
  456.      *
  457.      * @return Client
  458.      */
  459.     public function setFax($fax)
  460.     {
  461.         $this->fax $fax;
  462.         return $this;
  463.     }
  464.     /**
  465.      * Get fax
  466.      *
  467.      * @return string
  468.      */
  469.     public function getFax()
  470.     {
  471.         return $this->fax;
  472.     }
  473.     /**
  474.      * Set email
  475.      *
  476.      * @param string $email
  477.      *
  478.      * @return Client
  479.      */
  480.     public function setEmail($email)
  481.     {
  482.         $this->email $email;
  483.         return $this;
  484.     }
  485.     /**
  486.      * Get email
  487.      *
  488.      * @return string
  489.      */
  490.     public function getEmail()
  491.     {
  492.         return $this->email;
  493.     }
  494.     /**
  495.      * Set gds
  496.      *
  497.      * @param string $gds
  498.      *
  499.      * @return Client
  500.      */
  501.     public function setGds($gds)
  502.     {
  503.         $this->gds $gds;
  504.         return $this;
  505.     }
  506.     /**
  507.      * Get gds
  508.      *
  509.      * @return string
  510.      */
  511.     public function getGds()
  512.     {
  513.         return $this->gds;
  514.     }
  515.     /**
  516.      * Set idDocument
  517.      *
  518.      * @param string $idDocument
  519.      *
  520.      * @return Client
  521.      */
  522.     public function setIdDocument($idDocument)
  523.     {
  524.         $this->idDocument $idDocument;
  525.         return $this;
  526.     }
  527.     /**
  528.      * Get idDocument
  529.      *
  530.      * @return string
  531.      */
  532.     public function getIdDocument()
  533.     {
  534.         return $this->idDocument;
  535.     }
  536.     /**
  537.      * Set observation
  538.      *
  539.      * @param string $observation
  540.      *
  541.      * @return Client
  542.      */
  543.     public function setObservation($observation)
  544.     {
  545.         $this->observation $observation;
  546.         return $this;
  547.     }
  548.     /**
  549.      * Get observation
  550.      *
  551.      * @return string
  552.      */
  553.     public function getObservation()
  554.     {
  555.         return $this->observation;
  556.     }
  557.     /**
  558.      * Set idOffice
  559.      *
  560.      * @param integer $idOffice
  561.      *
  562.      * @return Client
  563.      */
  564.     public function setIdOffice($idOffice)
  565.     {
  566.         $this->idOffice $idOffice;
  567.         return $this;
  568.     }
  569.     /**
  570.      * Get idOffice
  571.      *
  572.      * @return int
  573.      */
  574.     public function getIdOffice()
  575.     {
  576.         return $this->idOffice;
  577.     }
  578.     /**
  579.      * Set createdAt
  580.      *
  581.      * @param \Datetime $createdAt
  582.      *
  583.      * @return Client
  584.      */
  585.     public function setCreatedAt(\Datetime $createdAt)
  586.     {
  587.         $this->createdAt $createdAt;
  588.         return $this;
  589.     }
  590.     /**
  591.      * Get createdAt
  592.      *
  593.      * @return \Datetime
  594.      */
  595.     public function getCreatedAt()
  596.     {
  597.         return $this->createdAt;
  598.     }
  599.     /**
  600.      * Set createdId
  601.      *
  602.      * @param integer $createdId
  603.      *
  604.      * @return Client
  605.      */
  606.     public function setCreatedId($createdId)
  607.     {
  608.         $this->createdId $createdId;
  609.         return $this;
  610.     }
  611.     /**
  612.      * Get createdId
  613.      *
  614.      * @return int
  615.      */
  616.     public function getCreatedId()
  617.     {
  618.         return $this->createdId;
  619.     }
  620.     /**
  621.      * Set updatedAt
  622.      *
  623.      * @param \Datetime $updatedAt
  624.      *
  625.      * @return Client
  626.      */
  627.     public function setUpdatedAt(\Datetime $updatedAt)
  628.     {
  629.         $this->updatedAt $updatedAt;
  630.         return $this;
  631.     }
  632.     /**
  633.      * Get updatedAt
  634.      *
  635.      * @return \Datetime
  636.      */
  637.     public function getUpdatedAt()
  638.     {
  639.         return $this->updatedAt;
  640.     }
  641.     /**
  642.      * Set updatedId
  643.      *
  644.      * @param integer $updatedId
  645.      *
  646.      * @return Client
  647.      */
  648.     public function setUpdatedId($updatedId)
  649.     {
  650.         $this->updatedId $updatedId;
  651.         return $this;
  652.     }
  653.     /**
  654.      * Get updatedId
  655.      *
  656.      * @return int
  657.      */
  658.     public function getUpdatedId()
  659.     {
  660.         return $this->updatedId;
  661.     }
  662.     /**
  663.      * Set state
  664.      *
  665.      * @param boolean $state
  666.      *
  667.      * @return Client
  668.      */
  669.     public function setState($state)
  670.     {
  671.         $this->state $state;
  672.         return $this;
  673.     }
  674.     /**
  675.      * Get state
  676.      *
  677.      * @return int
  678.      */
  679.     public function getState()
  680.     {
  681.         return $this->state;
  682.     }
  683.     /**
  684.      * Set picture
  685.      *
  686.      * @param string $picture
  687.      *
  688.      * @return Client
  689.      */
  690.     public function setPicture($picture)
  691.     {
  692.         $this->picture $picture;
  693.         return $this;
  694.     }
  695.     /**
  696.      * Get picture
  697.      *
  698.      * @return string
  699.      */
  700.     public function getPicture()
  701.     {
  702.         return $this->picture;
  703.     }
  704.     /**
  705.      * @ORM\PrePersist
  706.      */
  707.     public function setCreatedAtValue()
  708.     {
  709.         $this->createdAt = new \Datetime();
  710.     }
  711.     /**
  712.      * @ORM\PrePersist
  713.      * @ORM\PreUpdate
  714.      */
  715.     public function setUpdatedAtValue()
  716.     {
  717.         $this->updatedAt = new \Datetime();
  718.     }
  719.     /**
  720.      * Set groupId
  721.      *
  722.      * @param integer $groupId
  723.      *
  724.      * @return Client
  725.      */
  726.     public function setGroupId($groupId)
  727.     {
  728.         $this->groupId $groupId;
  729.         return $this;
  730.     }
  731.     /**
  732.      * Get groupId
  733.      *
  734.      * @return integer
  735.      */
  736.     public function getGroupId()
  737.     {
  738.         return $this->groupId;
  739.     }
  740.     /**
  741.      * Set competency
  742.      *
  743.      * @param string $competency
  744.      *
  745.      * @return Client
  746.      */
  747.     public function setCompetency($competency)
  748.     {
  749.         $this->competency $competency;
  750.         return $this;
  751.     }
  752.     /**
  753.      * Get competency
  754.      *
  755.      * @return string
  756.      */
  757.     public function getCompetency()
  758.     {
  759.         return $this->competency;
  760.     }
  761.     /**
  762.      * Set action
  763.      *
  764.      * @param string $action
  765.      *
  766.      * @return Client
  767.      */
  768.     public function setAction($action)
  769.     {
  770.         $this->action $action;
  771.         return $this;
  772.     }
  773.     /**
  774.      * Get action
  775.      *
  776.      * @return string
  777.      */
  778.     public function getAction()
  779.     {
  780.         return $this->action;
  781.     }
  782.     /**
  783.      * Set typeDocument
  784.      *
  785.      * @param string $typeDocument
  786.      *
  787.      * @return Client
  788.      */
  789.     public function setTypeDocument($typeDocument)
  790.     {
  791.         $this->typeDocument $typeDocument;
  792.         return $this;
  793.     }
  794.     /**
  795.      * Get typeDocument
  796.      *
  797.      * @return string
  798.      */
  799.     public function getTypeDocument()
  800.     {
  801.         return $this->typeDocument;
  802.     }
  803.     /**
  804.      * Set returnInvestment
  805.      *
  806.      * @param string $returnInvestment
  807.      *
  808.      * @return Client
  809.      */
  810.     public function setReturnInvestment($returnInvestment)
  811.     {
  812.         $this->returnInvestment $returnInvestment;
  813.         return $this;
  814.     }
  815.     /**
  816.      * Get returnInvestment
  817.      *
  818.      * @return string
  819.      */
  820.     public function getReturnInvestment()
  821.     {
  822.         return $this->returnInvestment;
  823.     }
  824.     /**
  825.      * Set region
  826.      *
  827.      * @param string $region
  828.      *
  829.      * @return Client
  830.      */
  831.     public function setRegion($region)
  832.     {
  833.         $this->region $region;
  834.         return $this;
  835.     }
  836.     /**
  837.      * Get region
  838.      *
  839.      * @return string
  840.      */
  841.     public function getRegion()
  842.     {
  843.         return $this->region;
  844.     }
  845.     /**
  846.      * Set isClientInOut
  847.      *
  848.      * @param boolean $isClientInOut
  849.      *
  850.      * @return Client
  851.      */
  852.     public function setIsClientInOut($isClientInOut)
  853.     {
  854.         $this->isClientInOut $isClientInOut;
  855.         return $this;
  856.     }
  857.     /**
  858.      * Get isClientInOut
  859.      *
  860.      * @return boolean
  861.      */
  862.     public function getIsClientInOut()
  863.     {
  864.         return $this->isClientInOut;
  865.     }
  866.     /**
  867.      * Set isClientGreenPatio
  868.      *
  869.      * @param boolean $isClientGreenPatio
  870.      *
  871.      * @return Client
  872.      */
  873.     public function setIsClientGreenPatio($isClientGreenPatio)
  874.     {
  875.         $this->isClientGreenPatio $isClientGreenPatio;
  876.         return $this;
  877.     }
  878.     /**
  879.      * Get isClientGreenPatio
  880.      *
  881.      * @return boolean
  882.      */
  883.     public function getIsClientGreenPatio()
  884.     {
  885.         return $this->isClientGreenPatio;
  886.     }
  887.     /**
  888.      * Set isClientAvExpress
  889.      *
  890.      * @param boolean $isClientAvExpress
  891.      *
  892.      * @return Client
  893.      */
  894.     public function setIsClientAvExpress($isClientAvExpress)
  895.     {
  896.         $this->isClientAvExpress $isClientAvExpress;
  897.         return $this;
  898.     }
  899.     /**
  900.      * Get isClientAvExpress
  901.      *
  902.      * @return boolean
  903.      */
  904.     public function getIsClientAvExpress()
  905.     {
  906.         return $this->isClientAvExpress;
  907.     }
  908.     /**
  909.      * Set isClientDevelup
  910.      *
  911.      * @param boolean $isClientDevelup
  912.      *
  913.      * @return Client
  914.      */
  915.     public function setIsClientDevelup($isClientDevelup)
  916.     {
  917.         $this->isClientDevelup $isClientDevelup;
  918.         return $this;
  919.     }
  920.     /**
  921.      * Get isClientDevelup
  922.      *
  923.      * @return boolean
  924.      */
  925.     public function getIsClientDevelup()
  926.     {
  927.         return $this->isClientDevelup;
  928.     }
  929.     public function getTypology(): ?string
  930.     {
  931.         return $this->typology;
  932.     }
  933.     public function setTypology(?string $typology): self
  934.     {
  935.         if (!Typology::isValid($typology)) {
  936.             throw new \InvalidArgumentException("Sector inválido: $typology");
  937.         }
  938.         $this->typology $typology;
  939.         return $this;
  940.     }
  941. }