src/Entity/Traveaux.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TraveauxRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassTraveauxRepository::class)]
  9. class Traveaux
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column]
  16.     private ?\DateTimeImmutable $createdAt null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $numeroTraveaux null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $commentaire null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $status null;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     private ?string $detailsTraveaux null;
  25.     #[ORM\ManyToOne(inversedBy'traveauxes')]
  26.     private ?User $responsable null;
  27.     #[ORM\ManyToOne(inversedBy'traveauxes')]     
  28.     private ?Service $service null;
  29.     #[ORM\ManyToOne(inversedBy'traveauxes')]
  30.     private ?JobCard $jobCard null;
  31.     #[ORM\OneToMany(mappedBy'travaux'targetEntityStockDePiecesTraveaux::class, cascade: ['persist'])]
  32.     private Collection $stockDePiecesTraveauxes;
  33.     public function __construct()  
  34.     {
  35.         $this->createdAt = new \DateTimeImmutable();
  36.         $this->status 'A FAIRE';
  37.         $this->stockDePiecesTraveauxes = new ArrayCollection();
  38.         
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getCreatedAt(): ?\DateTimeImmutable
  45.     {
  46.         return $this->createdAt;
  47.     }
  48.     public function setCreatedAt(\DateTimeImmutable $createdAt): static
  49.     {
  50.         $this->createdAt $createdAt;
  51.         return $this;
  52.     }
  53.     public function getNumeroTraveaux(): ?string
  54.     {
  55.         return $this->numeroTraveaux;
  56.     }
  57.     public function setNumeroTraveaux(?string $numeroTraveaux): static
  58.     {
  59.         $this->numeroTraveaux $numeroTraveaux;
  60.         return $this;
  61.     }
  62.     public function getCommentaire(): ?string
  63.     {
  64.         return $this->commentaire;
  65.     }
  66.     public function setCommentaire(?string $commentaire): static
  67.     {
  68.         $this->commentaire $commentaire;
  69.         return $this;
  70.     }
  71.     public function getStatus(): ?string
  72.     {
  73.         return $this->status;
  74.     }
  75.     public function setStatus(?string $status): static
  76.     {
  77.         $this->status $status;
  78.         return $this;
  79.     }
  80.     public function getDetailsTraveaux(): ?string
  81.     {
  82.         return $this->detailsTraveaux;
  83.     }
  84.     public function setDetailsTraveaux(?string $detailsTraveaux): static
  85.     {
  86.         $this->detailsTraveaux $detailsTraveaux;
  87.         return $this;
  88.     }
  89.     public function getResponsable(): ?User
  90.     {
  91.         return $this->responsable;
  92.     }
  93.     public function setResponsable(?User $responsable): static
  94.     {
  95.         $this->responsable $responsable;
  96.         return $this;
  97.     }
  98.     public function getService(): ?Service
  99.     {
  100.         return $this->service;
  101.     }
  102.     public function setService(?Service $service): static
  103.     {
  104.         $this->service $service;
  105.         return $this;
  106.     }
  107.     
  108.     public function getJobCard(): ?JobCard
  109.     {
  110.         return $this->jobCard;
  111.     }
  112.     public function setJobCard(?JobCard $jobCard): static
  113.     {
  114.         $this->jobCard $jobCard;
  115.         return $this;
  116.     }
  117.     /**
  118.      * @return Collection<int, StockDePiecesTraveaux>
  119.      */
  120.     public function getStockDePiecesTraveauxes(): Collection
  121.     {
  122.         return $this->stockDePiecesTraveauxes;
  123.     }
  124.     public function addStockDePiecesTraveaux(StockDePiecesTraveaux $stockDePiecesTraveaux): static
  125.     {
  126.         if (!$this->stockDePiecesTraveauxes->contains($stockDePiecesTraveaux)) {
  127.             $this->stockDePiecesTraveauxes->add($stockDePiecesTraveaux);
  128.             $stockDePiecesTraveaux->setTravaux($this);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeStockDePiecesTraveaux(StockDePiecesTraveaux $stockDePiecesTraveaux): static
  133.     {
  134.         if ($this->stockDePiecesTraveauxes->removeElement($stockDePiecesTraveaux)) {
  135.             // set the owning side to null (unless already changed)
  136.             if ($stockDePiecesTraveaux->getTravaux() === $this) {
  137.                 $stockDePiecesTraveaux->setTravaux(null);
  138.             }
  139.         }
  140.         return $this;
  141.     } 
  142. }