<?phpnamespace App\Entity;use App\Repository\PackRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=PackRepository::class) */class Pack{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * * @ORM\Column(type="text", nullable=true) */ private $description; /** * * @ORM\Column(type="float") */ private $price_ttc; /** * * @ORM\ManyToMany(targetEntity=File::class, cascade={"persist"}) */ private $pictures; /** * @ORM\ManyToMany(targetEntity=ProduitDeclinationValue::class, inversedBy="packs") */ private $declinations; /** * @ORM\OneToMany(targetEntity=DocumentProduit::class, mappedBy="pack") */ private $documentPacks; /** * @ORM\Column(type="boolean", nullable=true) */ private $isArchived; public function __construct() { $this->declinations = new ArrayCollection(); $this->pictures = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function adddeclination(ProduitDeclinationValue $declination) { if (!$this->declinations->contains($declination)) { $this->declinations[] = $declination; } } public function removedeclination(ProduitDeclinationValue $declination) { $this->declinations->removeElement($declination); } public function getdeclinations(): Collection { return $this->declinations; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getPriceTtc(): ?float { return $this->price_ttc; } public function setPriceTtc(float $price_ttc): self { $this->price_ttc = $price_ttc; return $this; } /** * @return Collection|File[] */ public function getPicture(): Collection { return $this->picture; } public function addPicture(File $picture): self { if( !$this->picture->contains($picture)) { $this->picture[] = $picture; } return $this; } public function removePicture(File $picture): self { $this->picture->removeElement($picture); return $this; } public function getIsArchived(): ?bool { return $this->isArchived; } public function setIsArchived(?bool $isArchived): self { $this->isArchived = $isArchived; return $this; }}