<?php
namespace App\Entity;
use App\Entity\CodeNaf;
use App\Entity\Workforce;
use App\Entity\Departement;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\FilesUserRepository;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: FilesUserRepository::class)]
class FilesUser
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'filesUsers')]
#[ORM\JoinColumn(nullable: false)]
private ?User $user = null;
#[ORM\Column(length: 255)]
private ?string $state = null;
#[ORM\Column]
private ?bool $isPaid = null;
#[ORM\Column(nullable: false)]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\ManyToMany(targetEntity: Workforce::class)]
private Collection $workforce;
#[ORM\Column]
private ?bool $isReadyToDownload = null;
#[ORM\Column(nullable: true)]
private array $data = [];
#[ORM\Column]
private ?bool $isFileVerified = null;
#[ORM\Column]
private ?bool $haveData = null;
#[ORM\ManyToMany(targetEntity: CodeNaf::class)]
private Collection $codeNaf;
#[ORM\ManyToMany(targetEntity: Departement::class)]
private Collection $departement;
#[ORM\ManyToMany(targetEntity: Coordinates::class)]
private Collection $coordinates;
public function __construct()
{
$this->workforce = new ArrayCollection();
$this->codeNaf = new ArrayCollection();
$this->departement = new ArrayCollection();
$this->coordinates = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(string $state): self
{
$this->state = $state;
return $this;
}
public function isIsPaid(): ?bool
{
return $this->isPaid;
}
public function setIsPaid(bool $isPaid): self
{
$this->isPaid = $isPaid;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection<int, Workforce>
*/
public function getWorkforce(): Collection
{
return $this->workforce;
}
public function addWorkforce(Workforce $workforce): self
{
if (!$this->workforce->contains($workforce)) {
$this->workforce->add($workforce);
}
return $this;
}
public function removeWorkforce(Workforce $workforce): self
{
$this->workforce->removeElement($workforce);
return $this;
}
public function isIsReadyToDownload(): ?bool
{
return $this->isReadyToDownload;
}
public function setIsReadyToDownload(bool $isReadyToDownload): self
{
$this->isReadyToDownload = $isReadyToDownload;
return $this;
}
public function getData(): array
{
return $this->data;
}
public function setData(?array $data): self
{
$this->data = $data;
return $this;
}
public function isIsFileVerified(): ?bool
{
return $this->isFileVerified;
}
public function setIsFileVerified(bool $isFileVerified): self
{
$this->isFileVerified = $isFileVerified;
return $this;
}
public function isHaveData(): ?bool
{
return $this->haveData;
}
public function setHaveData(bool $haveData): self
{
$this->haveData = $haveData;
return $this;
}
/**
* @return Collection<int, CodeNaf>
*/
public function getCodeNaf(): Collection
{
return $this->codeNaf;
}
public function addCodeNaf(CodeNaf $codeNaf): self
{
if (!$this->codeNaf->contains($codeNaf)) {
$this->codeNaf->add($codeNaf);
}
return $this;
}
public function removeCodeNaf(CodeNaf $codeNaf): self
{
$this->codeNaf->removeElement($codeNaf);
return $this;
}
/**
* @return Collection<int, Departement>
*/
public function getDepartement(): Collection
{
return $this->departement;
}
public function addDepartement(Departement $departement): self
{
if (!$this->departement->contains($departement)) {
$this->departement->add($departement);
}
return $this;
}
public function removeDepartement(Departement $departement): self
{
$this->departement->removeElement($departement);
return $this;
}
#[Groups(['read:FILESUSER:collection:noData', 'read:FILESUSER:collection:notVerified'])]
public function getCountCodeNaf(): int
{
return count($this->codeNaf);
}
#[Groups(['read:FILESUSER:collection:noData', 'read:FILESUSER:collection:notVerified'])]
public function getCountDepartement(): int
{
return count($this->departement);
}
#[Groups(['read:FILESUSER:collection:noData', 'read:FILESUSER:collection:notVerified'])]
public function getCountWorkforce(): int
{
return count($this->workforce);
}
/**
* @return Collection<int, Coordinates>
*/
public function getCoordinates(): Collection
{
return $this->coordinates;
}
public function addCoordinate(Coordinates $coordinate): self
{
if (!$this->coordinates->contains($coordinate)) {
$this->coordinates->add($coordinate);
}
return $this;
}
public function removeCoordinate(Coordinates $coordinate): self
{
$this->coordinates->removeElement($coordinate);
return $this;
}
}