src/Entity/Internaute.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InternauteRepository;
  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. #[ORM\Entity(repositoryClassInternauteRepository::class)]
  9. class Internaute
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     #[Assert\Length(max255)]
  17.     private ?string $firstname null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     #[Assert\Length(max255)]
  20.     private ?string $lastname null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     #[Assert\Length(max255)]
  23.     private ?string $company null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     #[Assert\Length(max255)]
  26.     private ?string $country null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     #[Assert\Length(max255)]
  29.     private ?string $address null;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     #[Assert\Length(max255)]
  32.     private ?string $address2 null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     #[Assert\Length(max255)]
  35.     private ?string $postalCode null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     #[Assert\Length(max255)]
  38.     private ?string $town null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     #[Assert\Email]
  41.     #[Assert\Length(max255)]
  42.     private ?string $email null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     #[Assert\Length(max255)]
  45.     private ?string $phone null;
  46.     #[ORM\OneToMany(mappedBy'internaute'targetEntityClientOrder::class)]
  47.     private Collection $clientOrders;
  48.     #[ORM\OneToMany(mappedBy'internaute'targetEntityMail::class)]
  49.     private Collection $mails;
  50.     #[ORM\Column(length255nullabletrue)]
  51.     private ?string $loyalty_card null;
  52.     public function __construct()
  53.     {
  54.         $this->clientOrders = new ArrayCollection();
  55.         $this->mails = new ArrayCollection();
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getFirstname(): ?string
  62.     {
  63.         return $this->firstname;
  64.     }
  65.     public function setFirstname(?string $firstname): static
  66.     {
  67.         $this->firstname $firstname;
  68.         return $this;
  69.     }
  70.     public function getLastname(): ?string
  71.     {
  72.         return $this->lastname;
  73.     }
  74.     public function setLastname(?string $lastname): static
  75.     {
  76.         $this->lastname $lastname;
  77.         return $this;
  78.     }
  79.     public function getCompany(): ?string
  80.     {
  81.         return $this->company;
  82.     }
  83.     public function setCompany(?string $company): static
  84.     {
  85.         $this->company $company;
  86.         return $this;
  87.     }
  88.     public function getCountry(): ?string
  89.     {
  90.         return $this->country;
  91.     }
  92.     public function setCountry(?string $country): static
  93.     {
  94.         $this->country $country;
  95.         return $this;
  96.     }
  97.     public function getAddress(): ?string
  98.     {
  99.         return $this->address;
  100.     }
  101.     public function setAddress(?string $address): static
  102.     {
  103.         $this->address $address;
  104.         return $this;
  105.     }
  106.     public function getAddress2(): ?string
  107.     {
  108.         return $this->address2;
  109.     }
  110.     public function setAddress2(?string $address2): static
  111.     {
  112.         $this->address2 $address2;
  113.         return $this;
  114.     }
  115.     public function getPostalCode(): ?string
  116.     {
  117.         return $this->postalCode;
  118.     }
  119.     public function setPostalCode(?string $postalCode): static
  120.     {
  121.         $this->postalCode $postalCode;
  122.         return $this;
  123.     }
  124.     public function getTown(): ?string
  125.     {
  126.         return $this->town;
  127.     }
  128.     public function setTown(?string $town): static
  129.     {
  130.         $this->town $town;
  131.         return $this;
  132.     }
  133.     public function getEmail(): ?string
  134.     {
  135.         return $this->email;
  136.     }
  137.     public function setEmail(?string $email): static
  138.     {
  139.         $this->email $email;
  140.         return $this;
  141.     }
  142.     public function getPhone(): ?string
  143.     {
  144.         return $this->phone;
  145.     }
  146.     public function setPhone(?string $phone): static
  147.     {
  148.         $this->phone $phone;
  149.         return $this;
  150.     }
  151.     /**
  152.      * @return Collection<int, ClientOrder>
  153.      */
  154.     public function getClientOrders(): Collection
  155.     {
  156.         return $this->clientOrders;
  157.     }
  158.     public function addClientOrder(ClientOrder $clientOrder): static
  159.     {
  160.         if (!$this->clientOrders->contains($clientOrder)) {
  161.             $this->clientOrders->add($clientOrder);
  162.             $clientOrder->setInternaute($this);
  163.         }
  164.         return $this;
  165.     }
  166.     public function removeClientOrder(ClientOrder $clientOrder): static
  167.     {
  168.         if ($this->clientOrders->removeElement($clientOrder)) {
  169.             // set the owning side to null (unless already changed)
  170.             if ($clientOrder->getInternaute() === $this) {
  171.                 $clientOrder->setInternaute(null);
  172.             }
  173.         }
  174.         return $this;
  175.     }
  176.     /**
  177.      * @return Collection<int, Mail>
  178.      */
  179.     public function getMails(): Collection
  180.     {
  181.         return $this->mails;
  182.     }
  183.     public function addMail(Mail $mail): static
  184.     {
  185.         if (!$this->mails->contains($mail)) {
  186.             $this->mails->add($mail);
  187.             $mail->setInternaute($this);
  188.         }
  189.         return $this;
  190.     }
  191.     public function removeMail(Mail $mail): static
  192.     {
  193.         if ($this->mails->removeElement($mail)) {
  194.             // set the owning side to null (unless already changed)
  195.             if ($mail->getInternaute() === $this) {
  196.                 $mail->setInternaute(null);
  197.             }
  198.         }
  199.         return $this;
  200.     }
  201.     public function getLoyaltyCard(): ?string
  202.     {
  203.         return $this->loyalty_card;
  204.     }
  205.     public function setLoyaltyCard(?string $loyalty_card): static
  206.     {
  207.         $this->loyalty_card $loyalty_card;
  208.         return $this;
  209.     }
  210.     public function __toString(): string
  211.     {
  212.         return sprintf('Internaute: %s %s (%s)'$this->firstname$this->lastname$this->email);
  213.     }
  214. }