src/Entity/Client/SupportUser.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Client;
  3. use App\Entity\Request\RequestComment;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Request\RequestForm;
  7. use Doctrine\Common\Collections\Collection;
  8. use App\Repository\Client\SupportUserRepository;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Gedmo\Timestampable\Traits\TimestampableEntity;
  11. #[ORM\Entity(repositoryClassSupportUserRepository::class)]
  12. class SupportUser
  13. {
  14.     use TimestampableEntity;
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $email null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $name null;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     private ?string $token null;
  25.     #[ORM\ManyToOne(inversedBy'supportUsers')]
  26.     private ?Client $client null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  28.     private ?\DateTimeInterface $deletedAt null;
  29.     #[ORM\OneToMany(mappedBy'supportUser'targetEntityRequestForm::class)]
  30.     private Collection $requestForms;
  31.     #[ORM\Column(nullabletrue)]
  32.     private ?bool $isEnable null;
  33.     #[ORM\OneToMany(mappedBy'supportUser'targetEntityRequestComment::class)]
  34.     private Collection $requestComments;
  35.     public function __construct()
  36.     {
  37.         $this->requestForms = new ArrayCollection();
  38.         $this->requestComments = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getEmail(): ?string
  45.     {
  46.         return $this->email;
  47.     }
  48.     public function setEmail(?string $email): static
  49.     {
  50.         $this->email $email;
  51.         return $this;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(?string $name): static
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     public function getToken(): ?string
  63.     {
  64.         return $this->token;
  65.     }
  66.     public function setToken(?string $token): static
  67.     {
  68.         $this->token $token;
  69.         return $this;
  70.     }
  71.     public function getClient(): ?Client
  72.     {
  73.         return $this->client;
  74.     }
  75.     public function setClient(?Client $client): static
  76.     {
  77.         $this->client $client;
  78.         return $this;
  79.     }
  80.     public function getDeletedAt(): ?\DateTimeInterface
  81.     {
  82.         return $this->deletedAt;
  83.     }
  84.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  85.     {
  86.         $this->deletedAt $deletedAt;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return Collection<int, RequestForm>
  91.      */
  92.     public function getRequestForms(): Collection
  93.     {
  94.         return $this->requestForms;
  95.     }
  96.     public function addRequestForm(RequestForm $requestForm): static
  97.     {
  98.         if (!$this->requestForms->contains($requestForm)) {
  99.             $this->requestForms->add($requestForm);
  100.             $requestForm->setSupportUser($this);
  101.         }
  102.         return $this;
  103.     }
  104.     public function removeRequestForm(RequestForm $requestForm): static
  105.     {
  106.         if ($this->requestForms->removeElement($requestForm)) {
  107.             // set the owning side to null (unless already changed)
  108.             if ($requestForm->getSupportUser() === $this) {
  109.                 $requestForm->setSupportUser(null);
  110.             }
  111.         }
  112.         return $this;
  113.     }
  114.     public function isIsEnable(): ?bool
  115.     {
  116.         return $this->isEnable;
  117.     }
  118.     public function setIsEnable(?bool $isEnable): static
  119.     {
  120.         $this->isEnable $isEnable;
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, RequestComment>
  125.      */
  126.     public function getRequestComments(): Collection
  127.     {
  128.         return $this->requestComments;
  129.     }
  130.     public function addRequestComment(RequestComment $requestComment): static
  131.     {
  132.         if (!$this->requestComments->contains($requestComment)) {
  133.             $this->requestComments->add($requestComment);
  134.             $requestComment->setSupportUser($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeRequestComment(RequestComment $requestComment): static
  139.     {
  140.         if ($this->requestComments->removeElement($requestComment)) {
  141.             // set the owning side to null (unless already changed)
  142.             if ($requestComment->getSupportUser() === $this) {
  143.                 $requestComment->setSupportUser(null);
  144.             }
  145.         }
  146.         return $this;
  147.     }
  148. }