src/Entity/PackageCompagny.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PackageCompagnyRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass=PackageCompagnyRepository::class)
  10.  */
  11. class PackageCompagny
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups("main")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      * @Groups("main")
  23.      */
  24.     private $name;
  25.    
  26.     /**
  27.      * @ORM\Column(type="decimal", precision=10, scale=2)
  28.      * @Groups("main")
  29.      */
  30.     private $priceHT;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=Tax::class, inversedBy="packageCompagnies")
  33.      * @Groups("main")
  34.      */
  35.     private $tax;
  36.     /**
  37.      * @ORM\Column(type="decimal", precision=10, scale=2)
  38.      * @Groups("main")
  39.      */
  40.     private $priceTTC;
  41.     /**
  42.      * @ORM\ManyToMany(targetEntity=CompagnyInfo::class, inversedBy="packageCompagnies")
  43.      */
  44.     private $compagny;
  45.     /**
  46.      * @ORM\Column(type="text")
  47.      * @Groups("main")
  48.      */
  49.     private $description;
  50.     /**
  51.      * @ORM\Column(type="integer", nullable=true)
  52.      */
  53.     private $minPers;
  54.     /**
  55.      * @ORM\Column(type="integer", nullable=true)
  56.      */
  57.     private $maxPers;
  58.     /**
  59.      * @ORM\Column(type="integer")
  60.      */
  61.     private $optionPrintIntervalPerson;
  62.     /**
  63.      * @ORM\ManyToMany(targetEntity=ShoppingCart::class, mappedBy="collectionPackages")
  64.      */
  65.     private $shoppingCarts;
  66.     /**
  67.      * @ORM\Column(type="json", nullable=true)
  68.      */
  69.     private $askDeposit=[];
  70.     public function __construct()
  71.     {
  72.         $this->compagny = new ArrayCollection();
  73.         $this->shoppingCarts = new ArrayCollection();
  74.     }
  75.    
  76.     public function getId(): ?int
  77.     {
  78.         return $this->id;
  79.     }
  80.     public function getName(): ?string
  81.     {
  82.         return $this->name;
  83.     }
  84.     public function setName(string $name): self
  85.     {
  86.         $this->name $name;
  87.         return $this;
  88.     }
  89.     
  90.     public function getPriceHT(): ?string
  91.     {
  92.         return $this->priceHT;
  93.     }
  94.     public function setPriceHT(string $priceHT): self
  95.     {
  96.         $this->priceHT $priceHT;
  97.         return $this;
  98.     }
  99.     public function getTax(): ?Tax
  100.     {
  101.         return $this->tax;
  102.     }
  103.     public function setTax(?Tax $tax): self
  104.     {
  105.         $this->tax $tax;
  106.         return $this;
  107.     }
  108.     public function getPriceTTC(): ?string
  109.     {
  110.         return $this->priceTTC;
  111.     }
  112.     public function setPriceTTC(string $priceTTC): self
  113.     {
  114.         $this->priceTTC $priceTTC;
  115.         return $this;
  116.     }
  117.     /**
  118.      * @return Collection|CompagnyInfo[]
  119.      */
  120.     public function getCompagny(): Collection
  121.     {
  122.         return $this->compagny;
  123.     }
  124.     public function addCompagny(CompagnyInfo $compagny): self
  125.     {
  126.         if (!$this->compagny->contains($compagny)) {
  127.             $this->compagny[] = $compagny;
  128.         }
  129.         return $this;
  130.     }
  131.     public function removeCompagny(CompagnyInfo $compagny): self
  132.     {
  133.         if ($this->compagny->contains($compagny)) {
  134.             $this->compagny->removeElement($compagny);
  135.         }
  136.         return $this;
  137.     }
  138.     public function getDescription(): ?string
  139.     {
  140.         return $this->description;
  141.     }
  142.     public function setDescription(string $description): self
  143.     {
  144.         $this->description $description;
  145.         return $this;
  146.     }
  147.     public function getMinPers(): ?int
  148.     {
  149.         return $this->minPers;
  150.     }
  151.     public function setMinPers(?int $minPers): self
  152.     {
  153.         $this->minPers $minPers;
  154.         return $this;
  155.     }
  156.     public function getMaxPers(): ?int
  157.     {
  158.         return $this->maxPers;
  159.     }
  160.     public function setMaxPers(?int $maxPers): self
  161.     {
  162.         $this->maxPers $maxPers;
  163.         return $this;
  164.     }
  165.     public function getOptionPrintIntervalPerson(): ?int
  166.     {
  167.         return $this->optionPrintIntervalPerson;
  168.     }
  169.     public function setOptionPrintIntervalPerson(int $optionPrintIntervalPerson): self
  170.     {
  171.         $this->optionPrintIntervalPerson $optionPrintIntervalPerson;
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return Collection|ShoppingCart[]
  176.      */
  177.     public function getShoppingCarts(): Collection
  178.     {
  179.         return $this->shoppingCarts;
  180.     }
  181.     public function addShoppingCart(ShoppingCart $shoppingCart): self
  182.     {
  183.         if (!$this->shoppingCarts->contains($shoppingCart)) {
  184.             $this->shoppingCarts[] = $shoppingCart;
  185.             $shoppingCart->addCollectionPackage($this);
  186.         }
  187.         return $this;
  188.     }
  189.     public function removeShoppingCart(ShoppingCart $shoppingCart): self
  190.     {
  191.         if ($this->shoppingCarts->removeElement($shoppingCart)) {
  192.             $shoppingCart->removeCollectionPackage($this);
  193.         }
  194.         return $this;
  195.     }
  196.     public function getAskDeposit(): ?array
  197.     {
  198.         return $this->askDeposit;
  199.     }
  200.     public function setAskDeposit(?array $askDeposit): self
  201.     {
  202.         $this->askDeposit $askDeposit;
  203.         return $this;
  204.     }
  205.     
  206. }