src/Entity/OrlProspect.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrlProspectRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use App\Validator as McaAssert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=OrlProspectRepository::class)
  11.  */
  12. class OrlProspect
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="smallint", nullable=true)
  22.      */
  23.     private $gender;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      * @Assert\NotBlank()
  27.      * @Assert\Length(
  28.      *      min = 2,
  29.      *      max = 50,
  30.      *
  31.      * )
  32.      */
  33.     private $firstname;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      * @Assert\NotBlank
  37.      * @Assert\Length(
  38.      *      min = 2,
  39.      *      max = 50,
  40.      * )
  41.      */
  42.     private $lastname;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      * @Assert\Length(
  46.      *      min = 2,
  47.      *      max = 50,
  48.      * )
  49.      */
  50.     private $address;
  51.     /**
  52.      * @ORM\Column(type="string", length=5)
  53.      * @Assert\Regex(
  54.      *      pattern="/^(([0-8][0-9])|(9[0-5])|(2[ab]))[0-9]{3}$/",
  55.      *      message="Le code postal n'est pas valide"
  56.      * )
  57.      */
  58.     private $postalCode;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      * @Assert\NotBlank()
  62.      * @Assert\Length(
  63.      *      min = 2,
  64.      *      max = 50,
  65.      * )
  66.      */
  67.     private $city;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      * @Assert\NotBlank
  71.      * @Assert\Email(
  72.      *     message = "L'email '{{ value }}' n'est pas valide",
  73.      *     mode = "strict"
  74.      * )
  75.      */
  76.     private $email;
  77.     /**
  78.      * @ORM\Column(type="string", length=255, nullable=true)
  79.      * @Assert\NotBlank
  80.      * @Assert\Regex(pattern="/^(?:\+33|0)\s*[1-9](?:[\s.-]*\d{2}){4}$/", message="Le numéro de téléphone n'est pas valide.")
  81.      * @McaAssert\ValidPhoneNumber
  82.      */
  83.     private $phoneNumber;
  84.     private $isPrivacy;
  85.     /**
  86.      * @ORM\Column(type="boolean")
  87.      */
  88.     private $isOptin;
  89.     /**
  90.      * @ORM\Column(type="boolean", nullable=true)
  91.      */
  92.     private $isPartnerOffer;
  93.     /**
  94.      * @ORM\OneToMany(targetEntity="App\Entity\OrlProspectOnOrlOffice", mappedBy="orlProspect", cascade={"persist", "remove"})
  95.      */
  96.     private $orlProspectsOnOrlOffice;
  97.     public function __construct()
  98.     {
  99.         $this->orlProspectsOnOrlOffice = new ArrayCollection();
  100.     }
  101.     public function getId(): ?int
  102.     {
  103.         return $this->id;
  104.     }
  105.     public function getGender(): ?int
  106.     {
  107.         return $this->gender;
  108.     }
  109.     public function setGender(?int $gender): self
  110.     {
  111.         $this->gender $gender;
  112.         return $this;
  113.     }
  114.     public function getFirstname(): ?string
  115.     {
  116.         return $this->firstname;
  117.     }
  118.     public function setFirstname(string $firstname): self
  119.     {
  120.         $this->firstname $firstname;
  121.         return $this;
  122.     }
  123.     public function getLastname(): ?string
  124.     {
  125.         return $this->lastname;
  126.     }
  127.     public function setLastname(string $lastname): self
  128.     {
  129.         $this->lastname $lastname;
  130.         return $this;
  131.     }
  132.     public function getAddress(): ?string
  133.     {
  134.         return $this->address;
  135.     }
  136.     public function setAddress(?string $address): self
  137.     {
  138.         $this->address $address;
  139.         return $this;
  140.     }
  141.     public function getPostalCode(): ?string
  142.     {
  143.         return $this->postalCode;
  144.     }
  145.     public function setPostalCode(string $postalCode): self
  146.     {
  147.         $this->postalCode $postalCode;
  148.         return $this;
  149.     }
  150.     public function getCity(): ?string
  151.     {
  152.         return $this->city;
  153.     }
  154.     public function setCity(?string $city): self
  155.     {
  156.         $this->city $city;
  157.         return $this;
  158.     }
  159.     public function getEmail(): ?string
  160.     {
  161.         return $this->email;
  162.     }
  163.     public function setEmail(?string $email): self
  164.     {
  165.         $this->email $email;
  166.         return $this;
  167.     }
  168.     public function getPhoneNumber(): ?string
  169.     {
  170.         return $this->phoneNumber;
  171.     }
  172.     public function setPhoneNumber(?string $phoneNumber): self
  173.     {
  174.         $this->phoneNumber $phoneNumber;
  175.         return $this;
  176.     }
  177.     public function getIsPrivacy(): ?bool
  178.     {
  179.         return $this->isPrivacy;
  180.     }
  181.     public function setIsPrivacy(bool $isPrivacy): self
  182.     {
  183.         $this->isPrivacy $isPrivacy;
  184.         return $this;
  185.     }
  186.     public function getIsOptin(): ?bool
  187.     {
  188.         return $this->isOptin;
  189.     }
  190.     public function setIsOptin(bool $isOptin): self
  191.     {
  192.         $this->isOptin $isOptin;
  193.         return $this;
  194.     }
  195.     public function getIsPartnerOffer(): ?bool
  196.     {
  197.         return $this->isPartnerOffer;
  198.     }
  199.     public function setIsPartnerOffer(?bool $isPartnerOffer): self
  200.     {
  201.         $this->isPartnerOffer $isPartnerOffer;
  202.         return $this;
  203.     }
  204.     /**
  205.      * @return Collection|OrlProspectOnOrlOffice[]
  206.      */
  207.     public function getOrlProspectsOnOrlOffice(): Collection
  208.     {
  209.         return $this->orlProspectsOnOrlOffice;
  210.     }
  211.     public function addOrlProspectsOnOrlOffice(OrlProspectOnOrlOffice $orlProspectsOnOrlOffice): self
  212.     {
  213.         if (!$this->orlProspectsOnOrlOffice->contains($orlProspectsOnOrlOffice)) {
  214.             $this->orlProspectsOnOrlOffice[] = $orlProspectsOnOrlOffice;
  215.             $orlProspectsOnOrlOffice->setOrlProspect($this);
  216.         }
  217.         return $this;
  218.     }
  219.     public function removeOrlProspectsOnOrlOffice(OrlProspectOnOrlOffice $orlProspectsOnOrlOffice): self
  220.     {
  221.         if ($this->orlProspectsOnOrlOffice->contains($orlProspectsOnOrlOffice)) {
  222.             $this->orlProspectsOnOrlOffice->removeElement($orlProspectsOnOrlOffice);
  223.             // set the owning side to null (unless already changed)
  224.             if ($orlProspectsOnOrlOffice->getOrlProspect() === $this) {
  225.                 $orlProspectsOnOrlOffice->setOrlProspect(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230. }