<?phpnamespace App\Entity;use App\Repository\TraveauxRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: TraveauxRepository::class)]class Traveaux{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column] private ?\DateTimeImmutable $createdAt = null; #[ORM\Column(length: 255, nullable: true)] private ?string $numeroTraveaux = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $commentaire = null; #[ORM\Column(length: 255, nullable: true)] private ?string $status = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $detailsTraveaux = null; #[ORM\ManyToOne(inversedBy: 'traveauxes')] private ?User $responsable = null; #[ORM\ManyToOne(inversedBy: 'traveauxes')] private ?Service $service = null; #[ORM\ManyToOne(inversedBy: 'traveauxes')] private ?JobCard $jobCard = null; #[ORM\OneToMany(mappedBy: 'travaux', targetEntity: StockDePiecesTraveaux::class, cascade: ['persist'])] private Collection $stockDePiecesTraveauxes; public function __construct() { $this->createdAt = new \DateTimeImmutable(); $this->status = 'A FAIRE'; $this->stockDePiecesTraveauxes = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getNumeroTraveaux(): ?string { return $this->numeroTraveaux; } public function setNumeroTraveaux(?string $numeroTraveaux): static { $this->numeroTraveaux = $numeroTraveaux; return $this; } public function getCommentaire(): ?string { return $this->commentaire; } public function setCommentaire(?string $commentaire): static { $this->commentaire = $commentaire; return $this; } public function getStatus(): ?string { return $this->status; } public function setStatus(?string $status): static { $this->status = $status; return $this; } public function getDetailsTraveaux(): ?string { return $this->detailsTraveaux; } public function setDetailsTraveaux(?string $detailsTraveaux): static { $this->detailsTraveaux = $detailsTraveaux; return $this; } public function getResponsable(): ?User { return $this->responsable; } public function setResponsable(?User $responsable): static { $this->responsable = $responsable; return $this; } public function getService(): ?Service { return $this->service; } public function setService(?Service $service): static { $this->service = $service; return $this; } public function getJobCard(): ?JobCard { return $this->jobCard; } public function setJobCard(?JobCard $jobCard): static { $this->jobCard = $jobCard; return $this; } /** * @return Collection<int, StockDePiecesTraveaux> */ public function getStockDePiecesTraveauxes(): Collection { return $this->stockDePiecesTraveauxes; } public function addStockDePiecesTraveaux(StockDePiecesTraveaux $stockDePiecesTraveaux): static { if (!$this->stockDePiecesTraveauxes->contains($stockDePiecesTraveaux)) { $this->stockDePiecesTraveauxes->add($stockDePiecesTraveaux); $stockDePiecesTraveaux->setTravaux($this); } return $this; } public function removeStockDePiecesTraveaux(StockDePiecesTraveaux $stockDePiecesTraveaux): static { if ($this->stockDePiecesTraveauxes->removeElement($stockDePiecesTraveaux)) { // set the owning side to null (unless already changed) if ($stockDePiecesTraveaux->getTravaux() === $this) { $stockDePiecesTraveaux->setTravaux(null); } } return $this; } }