<?php
namespace App\Entity\Project;
use App\Entity\Client\Client;
use App\Entity\Request\RequestForm;
use App\Entity\User\User;
use App\Repository\Project\ProjectRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProjectRepository::class)]
class Project
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $codeMonday = null;
#[ORM\ManyToOne(inversedBy: 'projects')]
private ?Client $client = null;
#[ORM\ManyToOne(inversedBy: 'projects')]
private ?User $user = null;
#[ORM\OneToMany(mappedBy: 'project', targetEntity: RequestForm::class)]
private Collection $requestForms;
public function __construct()
{
$this->requestForms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCodeMonday(): ?string
{
return $this->codeMonday;
}
public function setCodeMonday(string $codeMonday): static
{
$this->codeMonday = $codeMonday;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): static
{
$this->client = $client;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, RequestForm>
*/
public function getRequestForms(): Collection
{
return $this->requestForms;
}
public function addRequestForm(RequestForm $requestForm): static
{
if (!$this->requestForms->contains($requestForm)) {
$this->requestForms->add($requestForm);
$requestForm->setProject($this);
}
return $this;
}
public function removeRequestForm(RequestForm $requestForm): static
{
if ($this->requestForms->removeElement($requestForm)) {
// set the owning side to null (unless already changed)
if ($requestForm->getProject() === $this) {
$requestForm->setProject(null);
}
}
return $this;
}
}