src/Entity/FilesUser.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\CodeNaf;
  4. use App\Entity\Workforce;
  5. use App\Entity\Departement;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Repository\FilesUserRepository;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. #[ORM\Entity(repositoryClassFilesUserRepository::class)]
  12. class FilesUser
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\ManyToOne(inversedBy'filesUsers')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?User $user null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $state null;
  23.     #[ORM\Column]
  24.     private ?bool $isPaid null;
  25.     #[ORM\Column(nullablefalse)]
  26.     private ?\DateTimeImmutable $createdAt null;
  27.     #[ORM\ManyToMany(targetEntityWorkforce::class)]
  28.     private Collection $workforce;
  29.     #[ORM\Column]
  30.     private ?bool $isReadyToDownload null;
  31.     #[ORM\Column(nullabletrue)]
  32.     private array $data = [];
  33.     #[ORM\Column]
  34.     private ?bool $isFileVerified null;
  35.     #[ORM\Column]
  36.     private ?bool $haveData null;
  37.     #[ORM\ManyToMany(targetEntityCodeNaf::class)]
  38.     private Collection $codeNaf;
  39.     #[ORM\ManyToMany(targetEntityDepartement::class)]
  40.     private Collection $departement;
  41.     #[ORM\ManyToMany(targetEntityCoordinates::class)]
  42.     private Collection $coordinates;
  43.     public function __construct()
  44.     {
  45.         $this->workforce = new ArrayCollection();
  46.         $this->codeNaf = new ArrayCollection();
  47.         $this->departement = new ArrayCollection();
  48.         $this->coordinates = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getUser(): ?User
  55.     {
  56.         return $this->user;
  57.     }
  58.     public function setUser(?User $user): self
  59.     {
  60.         $this->user $user;
  61.         return $this;
  62.     }
  63.     public function getState(): ?string
  64.     {
  65.         return $this->state;
  66.     }
  67.     public function setState(string $state): self
  68.     {
  69.         $this->state $state;
  70.         return $this;
  71.     }
  72.     public function isIsPaid(): ?bool
  73.     {
  74.         return $this->isPaid;
  75.     }
  76.     public function setIsPaid(bool $isPaid): self
  77.     {
  78.         $this->isPaid $isPaid;
  79.         return $this;
  80.     }
  81.     public function getCreatedAt(): ?\DateTimeImmutable
  82.     {
  83.         return $this->createdAt;
  84.     }
  85.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  86.     {
  87.         $this->createdAt $createdAt;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection<int, Workforce>
  92.      */
  93.     public function getWorkforce(): Collection
  94.     {
  95.         return $this->workforce;
  96.     }
  97.     public function addWorkforce(Workforce $workforce): self
  98.     {
  99.         if (!$this->workforce->contains($workforce)) {
  100.             $this->workforce->add($workforce);
  101.         }
  102.         return $this;
  103.     }
  104.     public function removeWorkforce(Workforce $workforce): self
  105.     {
  106.         $this->workforce->removeElement($workforce);
  107.         return $this;
  108.     }
  109.     public function isIsReadyToDownload(): ?bool
  110.     {
  111.         return $this->isReadyToDownload;
  112.     }
  113.     public function setIsReadyToDownload(bool $isReadyToDownload): self
  114.     {
  115.         $this->isReadyToDownload $isReadyToDownload;
  116.         return $this;
  117.     }
  118.     public function getData(): array
  119.     {
  120.         return $this->data;
  121.     }
  122.     public function setData(?array $data): self
  123.     {
  124.         $this->data $data;
  125.         return $this;
  126.     }
  127.     public function isIsFileVerified(): ?bool
  128.     {
  129.         return $this->isFileVerified;
  130.     }
  131.     public function setIsFileVerified(bool $isFileVerified): self
  132.     {
  133.         $this->isFileVerified $isFileVerified;
  134.         return $this;
  135.     }
  136.     public function isHaveData(): ?bool
  137.     {
  138.         return $this->haveData;
  139.     }
  140.     public function setHaveData(bool $haveData): self
  141.     {
  142.         $this->haveData $haveData;
  143.         return $this;
  144.     }
  145.     /**
  146.      * @return Collection<int, CodeNaf>
  147.      */
  148.     public function getCodeNaf(): Collection
  149.     {
  150.         return $this->codeNaf;
  151.     }
  152.     public function addCodeNaf(CodeNaf $codeNaf): self
  153.     {
  154.         if (!$this->codeNaf->contains($codeNaf)) {
  155.             $this->codeNaf->add($codeNaf);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeCodeNaf(CodeNaf $codeNaf): self
  160.     {
  161.         $this->codeNaf->removeElement($codeNaf);
  162.         return $this;
  163.     }
  164.     /**
  165.      * @return Collection<int, Departement>
  166.      */
  167.     public function getDepartement(): Collection
  168.     {
  169.         return $this->departement;
  170.     }
  171.     public function addDepartement(Departement $departement): self
  172.     {
  173.         if (!$this->departement->contains($departement)) {
  174.             $this->departement->add($departement);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeDepartement(Departement $departement): self
  179.     {
  180.         $this->departement->removeElement($departement);
  181.         return $this;
  182.     }
  183.     #[Groups(['read:FILESUSER:collection:noData''read:FILESUSER:collection:notVerified'])]
  184.     public function getCountCodeNaf(): int
  185.     {
  186.         return count($this->codeNaf);
  187.     }
  188.     #[Groups(['read:FILESUSER:collection:noData''read:FILESUSER:collection:notVerified'])]
  189.     public function getCountDepartement(): int
  190.     {
  191.         return count($this->departement);
  192.     }
  193.     #[Groups(['read:FILESUSER:collection:noData''read:FILESUSER:collection:notVerified'])]
  194.     public function getCountWorkforce(): int
  195.     {
  196.         return count($this->workforce);
  197.     }
  198.     /**
  199.      * @return Collection<int, Coordinates>
  200.      */
  201.     public function getCoordinates(): Collection
  202.     {
  203.         return $this->coordinates;
  204.     }
  205.     public function addCoordinate(Coordinates $coordinate): self
  206.     {
  207.         if (!$this->coordinates->contains($coordinate)) {
  208.             $this->coordinates->add($coordinate);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeCoordinate(Coordinates $coordinate): self
  213.     {
  214.         $this->coordinates->removeElement($coordinate);
  215.         return $this;
  216.     }
  217. }