src/Entity/Agent.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AgentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=AgentRepository::class)
  9.  */
  10. class Agent
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $email;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $passwordToEmail;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=false)
  28.      */
  29.     private $howManyMessages 0;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $firstname;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $lastname;
  38.     /**
  39.      * @ORM\Column(type="string", length=255)
  40.      */
  41.     private $password;
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      */
  45.     private $agentRole;
  46.     /**
  47.      * @ORM\Column(type="string", length=1023, nullable=true)
  48.      */
  49.     private $imageUrl;
  50.     /**
  51.      * @ORM\Column(type="datetime", nullable=true)
  52.      */
  53.     private $emailAllowDate;
  54.     /**
  55.      * @ORM\OneToMany(targetEntity=Customer::class, mappedBy="agent")
  56.      */
  57.     private $customers;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=Mail::class, mappedBy="agent")
  60.      */
  61.     private $mails;
  62.     public function __construct()
  63.     {
  64.         $this->customers = new ArrayCollection();
  65.         $this->mails = new ArrayCollection();
  66.     }
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     /**
  72.      * @return mixed
  73.      */
  74.     public function getEmail(): string
  75.     {
  76.         return $this->email;
  77.     }
  78.     public function setEmail($email): self
  79.     {
  80.         $this->email $email;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return mixed
  85.      */
  86.     public function getPasswordToEmail()
  87.     {
  88.         return $this->passwordToEmail;
  89.     }
  90.     /**
  91.      * @param mixed $passwordToEmail
  92.      */
  93.     public function setPasswordToEmail($passwordToEmail): void
  94.     {
  95.         $this->passwordToEmail $passwordToEmail;
  96.     }
  97.     /**
  98.      * @return mixed
  99.      */
  100.     public function getHowManyMessages()
  101.     {
  102.         return $this->howManyMessages;
  103.     }
  104.     /**
  105.      * @param mixed $howManyMessages
  106.      */
  107.     public function setHowManyMessages($howManyMessages): void
  108.     {
  109.         $this->howManyMessages $howManyMessages;
  110.     }
  111.     public function getFirstname(): ?string
  112.     {
  113.         return $this->firstname;
  114.     }
  115.     public function setFirstname(string $firstname): self
  116.     {
  117.         $this->firstname $firstname;
  118.         return $this;
  119.     }
  120.     public function getLastname(): ?string
  121.     {
  122.         return $this->lastname;
  123.     }
  124.     public function setLastname(string $lastname): self
  125.     {
  126.         $this->lastname $lastname;
  127.         return $this;
  128.     }
  129.     public function getPassword(): ?string
  130.     {
  131.         return $this->password;
  132.     }
  133.     public function setPassword(string $password): self
  134.     {
  135.         $this->password $password;
  136.         return $this;
  137.     }
  138.     public function getAgentRole(): ?string
  139.     {
  140.         return $this->agentRole;
  141.     }
  142.     public function setAgentRole($agentRole): self
  143.     {
  144.         $this->agentRole $agentRole;
  145.         return $this;
  146.     }
  147.     public function getImageUrl()
  148.     {
  149.         return $this->imageUrl;
  150.     }
  151.     public function setImageUrl($imageUrl): self
  152.     {
  153.         $this->imageUrl $imageUrl;
  154.         return $this;
  155.     }
  156.     /**
  157.      * @return Collection<int, Customer>
  158.      */
  159.     public function getCustomers(): Collection
  160.     {
  161.         return $this->customers;
  162.     }
  163.     public function addCustomer(Customer $customer): self
  164.     {
  165.         if (!$this->customers->contains($customer)) {
  166.             $this->customers[] = $customer;
  167.             $customer->setAgent($this);
  168.         }
  169.         return $this;
  170.     }
  171.     public function removeCustomer(Customer $customer): self
  172.     {
  173.         if ($this->customers->removeElement($customer)) {
  174.             // set the owning side to null (unless already changed)
  175.             if ($customer->getAgent() === $this) {
  176.                 $customer->setAgent(null);
  177.             }
  178.         }
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return Collection<int, Customer>
  183.      */
  184.     public function getMails(): Collection
  185.     {
  186.         return $this->mails;
  187.     }
  188.     public function addMail(Mail $email): self
  189.     {
  190.         if (!$this->mails->contains($email)) {
  191.             $this->mails[] = $email;
  192.             $email->setAgent($this);
  193.         }
  194.         return $this;
  195.     }
  196.     public function removeMail(Mail $email): self
  197.     {
  198.         if ($this->mails->removeElement($email)) {
  199.             // set the owning side to null (unless already changed)
  200.             if ($email->getAgent() === $this) {
  201.                 $email->setAgent(null);
  202.             }
  203.         }
  204.         return $this;
  205.     }
  206.     /**
  207.      * @return mixed
  208.      */
  209.     public function getEmailAllowDate()
  210.     {
  211.         return $this->emailAllowDate;
  212.     }
  213.     /**
  214.      * @param mixed $emailAllowDate
  215.      */
  216.     public function setEmailAllowDate($emailAllowDate): void
  217.     {
  218.         $this->emailAllowDate $emailAllowDate;
  219.     }
  220. }