src/Entity/Client/Client.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Client;
  3. use App\Entity\Project\Project;
  4. use App\Entity\Request\RequestForm;
  5. use App\Repository\Client\ClientRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Timestampable\Traits\TimestampableEntity;
  11. #[ORM\Entity(repositoryClassClientRepository::class)]
  12. class Client
  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 $internalRef null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $name null;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     private ?string $token null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  26.     private ?\DateTimeInterface $deletedAt null;
  27.     #[ORM\OneToMany(mappedBy'client'targetEntitySupportUser::class)]
  28.     private Collection $supportUsers;
  29.     #[ORM\Column(nullabletrueoptions: ['default' => true])]
  30.     private ?bool $isEnable true;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $codeClientMonday null;
  33.     #[ORM\OneToMany(mappedBy'client'targetEntityProject::class)]
  34.     private Collection $projects;
  35.     #[ORM\OneToMany(mappedBy'client'targetEntityRequestForm::class)]
  36.     private Collection $requestForms;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $clientIdNetisse null;
  39.     public function __construct()
  40.     {
  41.         $this->supportUsers = new ArrayCollection();
  42.         $this->projects = new ArrayCollection();
  43.         $this->requestForms = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getInternalRef(): ?string
  50.     {
  51.         return $this->internalRef;
  52.     }
  53.     public function setInternalRef(?string $internalRef): static
  54.     {
  55.         $this->internalRef $internalRef;
  56.         return $this;
  57.     }
  58.     public function getName(): ?string
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function setName(?string $name): static
  63.     {
  64.         $this->name $name;
  65.         return $this;
  66.     }
  67.     public function getToken(): ?string
  68.     {
  69.         return $this->token;
  70.     }
  71.     public function setToken(?string $token): static
  72.     {
  73.         $this->token $token;
  74.         return $this;
  75.     }
  76.     public function getDeletedAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->deletedAt;
  79.     }
  80.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  81.     {
  82.         $this->deletedAt $deletedAt;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection<int, SupportUser>
  87.      */
  88.     public function getSupportUsers(): Collection
  89.     {
  90.         return $this->supportUsers;
  91.     }
  92.     public function addSupportUser(SupportUser $supportUser): static
  93.     {
  94.         if (!$this->supportUsers->contains($supportUser)) {
  95.             $this->supportUsers->add($supportUser);
  96.             $supportUser->setClient($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeSupportUser(SupportUser $supportUser): static
  101.     {
  102.         if ($this->supportUsers->removeElement($supportUser)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($supportUser->getClient() === $this) {
  105.                 $supportUser->setClient(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110.     public function isIsEnable(): ?bool
  111.     {
  112.         return $this->isEnable;
  113.     }
  114.     public function setIsEnable(?bool $isEnable): static
  115.     {
  116.         $this->isEnable $isEnable;
  117.         return $this;
  118.     }
  119.     public function getCodeClientMonday(): ?string
  120.     {
  121.         return $this->codeClientMonday;
  122.     }
  123.     public function setCodeClientMonday(?string $codeClientMonday): static
  124.     {
  125.         $this->codeClientMonday $codeClientMonday;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, Project>
  130.      */
  131.     public function getProjects(): Collection
  132.     {
  133.         return $this->projects;
  134.     }
  135.     public function addProject(Project $project): static
  136.     {
  137.         if (!$this->projects->contains($project)) {
  138.             $this->projects->add($project);
  139.             $project->setClient($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeProject(Project $project): static
  144.     {
  145.         if ($this->projects->removeElement($project)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($project->getClient() === $this) {
  148.                 $project->setClient(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, RequestForm>
  155.      */
  156.     public function getRequestForms(): Collection
  157.     {
  158.         return $this->requestForms;
  159.     }
  160.     public function addRequestForm(RequestForm $requestForm): static
  161.     {
  162.         if (!$this->requestForms->contains($requestForm)) {
  163.             $this->requestForms->add($requestForm);
  164.             $requestForm->setClient($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeRequestForm(RequestForm $requestForm): static
  169.     {
  170.         if ($this->requestForms->removeElement($requestForm)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($requestForm->getClient() === $this) {
  173.                 $requestForm->setClient(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     public function getClientIdNetisse(): ?string
  179.     {
  180.         return $this->clientIdNetisse;
  181.     }
  182.     public function setClientIdNetisse(?string $clientIdNetisse): static
  183.     {
  184.         $this->clientIdNetisse $clientIdNetisse;
  185.         return $this;
  186.     }
  187. }