src/Entity/Pack.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PackRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PackRepository::class)
  9.  */
  10. class Pack
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      *
  24.      * @ORM\Column(type="text", nullable=true)
  25.      */
  26.     private $description;
  27.     /**
  28.      *
  29.      * @ORM\Column(type="float")
  30.      */
  31.     private $price_ttc;
  32.     /**
  33.      *
  34.      * @ORM\ManyToMany(targetEntity=File::class, cascade={"persist"})
  35.      */
  36.     private $pictures;
  37.     /**
  38.      * @ORM\ManyToMany(targetEntity=ProduitDeclinationValue::class, inversedBy="packs")
  39.      */
  40.     private $declinations;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity=DocumentProduit::class, mappedBy="pack")
  43.      */
  44.     private $documentPacks;
  45.     /**
  46.      * @ORM\Column(type="boolean", nullable=true)
  47.      */
  48.     private $isArchived;
  49.     public function __construct()
  50.     {
  51.         $this->declinations = new ArrayCollection();
  52.         $this->pictures = new ArrayCollection();
  53.     }
  54.     
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     
  60.     public function adddeclination(ProduitDeclinationValue $declination)
  61.     {
  62.         if (!$this->declinations->contains($declination)) {
  63.             $this->declinations[] = $declination;
  64.         }
  65.     }
  66.     public function removedeclination(ProduitDeclinationValue $declination)
  67.     {
  68.         $this->declinations->removeElement($declination);
  69.     }
  70.     public function getdeclinations(): Collection
  71.     {
  72.         return $this->declinations;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(string $name): self
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getDescription(): ?string
  84.     {
  85.         return $this->description;
  86.     }
  87.     public function setDescription(?string $description): self
  88.     {
  89.         $this->description $description;
  90.         return $this;
  91.     }
  92.     public function getPriceTtc(): ?float
  93.     {
  94.         return $this->price_ttc;
  95.     }
  96.     public function setPriceTtc(float $price_ttc): self
  97.     {
  98.         $this->price_ttc $price_ttc;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return Collection|File[]
  103.      */
  104.     public function getPicture(): Collection
  105.     {
  106.         return $this->picture;
  107.     }
  108.     public function addPicture(File $picture): self
  109.     {
  110.         if( !$this->picture->contains($picture)) {
  111.             $this->picture[] = $picture;
  112.         }
  113.         return $this;
  114.     }
  115.     public function removePicture(File $picture): self
  116.     {
  117.         $this->picture->removeElement($picture);
  118.         return $this;
  119.     }
  120.     public function getIsArchived(): ?bool
  121.     {
  122.         return $this->isArchived;
  123.     }
  124.     public function setIsArchived(?bool $isArchived): self
  125.     {
  126.         $this->isArchived $isArchived;
  127.         return $this;
  128.     }
  129. }