src/Entity/EntreStock.php line 11
<?phpnamespace App\Entity;use App\Repository\EntreStockRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: EntreStockRepository::class)]class EntreStock{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 50, nullable: true)]private ?string $ref = null;#[ORM\Column]private ?\DateTimeImmutable $createdAt = null;#[ORM\Column]private ?float $montantTotal = null;#[ORM\ManyToOne(inversedBy: 'entreStocks')]private ?Fournisseur $fournisseur = null;#[ORM\OneToMany(mappedBy: 'entreStock', targetEntity: Stock::class)]private Collection $stocks;public function __construct(){$this->stocks = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getRef(): ?string{return $this->ref;}public function setRef(?string $ref): self{$this->ref = $ref;return $this;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}public function getMontantTotal(): ?float{return $this->montantTotal;}public function setMontantTotal(float $montantTotal): self{$this->montantTotal = $montantTotal;return $this;}public function getFournisseur(): ?Fournisseur{return $this->fournisseur;}public function setFournisseur(?Fournisseur $fournisseur): self{$this->fournisseur = $fournisseur;return $this;}/*** @return Collection<int, Stock>*/public function getStocks(): Collection{return $this->stocks;}public function addStock(Stock $stock): self{if (!$this->stocks->contains($stock)) {$this->stocks->add($stock);$stock->setEntreStock($this);}return $this;}public function removeStock(Stock $stock): self{if ($this->stocks->removeElement($stock)) {// set the owning side to null (unless already changed)if ($stock->getEntreStock() === $this) {$stock->setEntreStock(null);}}return $this;}}