src/Entity/Stock.php line 12
<?php
namespace App\Entity;
use App\Entity\Participation\Participation;
use App\Repository\StockRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StockRepository::class)]
class Stock
{
const PARLIER_03 = 'PAL03';
const PARLIER_04 = 'PAL04';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $op_code = null;
#[ORM\Column]
private ?int $initial_stock = null;
#[ORM\Column]
private ?int $stock = null;
#[ORM\Column(length: 10)]
private ?string $pal = null;
#[ORM\ManyToMany(targetEntity: Participation::class, mappedBy: 'stocks')]
private Collection $participations;
#[ORM\Column(length: 30, nullable: true)]
private ?string $photo = null;
public function __construct()
{
$this->participations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): static
{
$this->label = $label;
return $this;
}
public function getOpCode(): ?string
{
return $this->op_code;
}
public function setOpCode(?string $op_code): static
{
$this->op_code = $op_code;
return $this;
}
public function getInitialStock(): ?int
{
return $this->initial_stock;
}
public function setInitialStock(int $initial_stock): static
{
$this->initial_stock = $initial_stock;
return $this;
}
public function getStock(): ?int
{
return $this->stock;
}
public function setStock(int $stock): static
{
$this->stock = $stock;
return $this;
}
public function getPal(): ?string
{
return $this->pal;
}
public function setPal(string $pal): static
{
$this->pal = $pal;
return $this;
}
/**
* @return Collection<int, Participation>
*/
public function getParticipations(): Collection
{
return $this->participations;
}
public function addParticipation(Participation $participation): static
{
if (!$this->participations->contains($participation)) {
$this->participations->add($participation);
$participation->addStock($this);
}
return $this;
}
public function removeParticipation(Participation $participation): static
{
if ($this->participations->removeElement($participation)) {
$participation->removeStock($this);
}
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): static
{
$this->photo = $photo;
return $this;
}
}