src/Entity/StockDePieces.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockDePiecesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassStockDePiecesRepository::class)]
  8. class StockDePieces
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255nullabletrue)]
  15.     private ?string $nomPiece null;
  16.     #[ORM\Column(nullabletrue)]
  17.     private ?int $prix null;
  18.     #[ORM\Column(nullabletrue)]
  19.     private ?int $quantite null;
  20.     #[ORM\Column(nullabletrue)]
  21.     private ?\DateTimeImmutable $createdAt null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?\DateTimeImmutable $updatedAt null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $reference null;
  26.     #[ORM\OneToMany(mappedBy'stockPieces'targetEntityStockDePiecesTraveaux::class, cascade: ['persist'])]
  27.     private Collection $stockDePiecesTraveauxes;
  28.     public function __construct()
  29.     {
  30.         
  31.         $this->createdAt = new \DateTimeImmutable();
  32.         $this->updatedAt = new \DateTimeImmutable();
  33.         $this->stockDePiecesTraveauxes = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getNomPiece(): ?string
  40.     {
  41.         return $this->nomPiece;
  42.     }
  43.     public function setNomPiece(?string $nomPiece): static
  44.     {
  45.         $this->nomPiece $nomPiece;
  46.         return $this;
  47.     }
  48.     public function getPrix(): ?int
  49.     {
  50.         return $this->prix;
  51.     }
  52.     public function setPrix(?int $prix): static
  53.     {
  54.         $this->prix $prix;
  55.         return $this;
  56.     }
  57.     public function getQuantite(): ?int
  58.     {
  59.         return $this->quantite;
  60.     }
  61.     public function setQuantite(?int $quantite): static
  62.     {
  63.         $this->quantite $quantite;
  64.         return $this;
  65.     }
  66.     
  67.     
  68.     public function getCreatedAt(): ?\DateTimeImmutable
  69.     {
  70.         return $this->createdAt;
  71.     }
  72.     public function setCreatedAt(?\DateTimeImmutable $createdAt): static
  73.     {
  74.         $this->createdAt $createdAt;
  75.         return $this;
  76.     }
  77.     public function getUpdatedAt(): ?\DateTimeImmutable
  78.     {
  79.         return $this->updatedAt;
  80.     }
  81.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
  82.     {
  83.         $this->updatedAt $updatedAt
  84.         return $this;
  85.     }
  86.     public function getReference(): ?string
  87.     {
  88.         return $this->reference;
  89.     }
  90.     public function setReference(?string $reference): static
  91.     {
  92.         $this->reference $reference;  
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return Collection<int, StockDePiecesTraveaux>
  97.      */
  98.     public function getStockDePiecesTraveauxes(): Collection
  99.     {
  100.         return $this->stockDePiecesTraveauxes;
  101.     }
  102.     public function addStockDePiecesTraveaux(StockDePiecesTraveaux $stockDePiecesTraveaux): static
  103.     {
  104.         if (!$this->stockDePiecesTraveauxes->contains($stockDePiecesTraveaux)) {
  105.             $this->stockDePiecesTraveauxes->add($stockDePiecesTraveaux);
  106.             $stockDePiecesTraveaux->setStockPieces($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeStockDePiecesTraveaux(StockDePiecesTraveaux $stockDePiecesTraveaux): static
  111.     {
  112.         if ($this->stockDePiecesTraveauxes->removeElement($stockDePiecesTraveaux)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($stockDePiecesTraveaux->getStockPieces() === $this) {
  115.                 $stockDePiecesTraveaux->setStockPieces(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }  
  120. }