src/Entity/Marchandise.php line 21

Open in your IDE?
  1. <?php
  2. /* -- !!!!! CETTE CLASSE CORRESPOND AUX PRODUITS ET LA CLASSE !!!!! -- */
  3. /* -- !!!!! "Product" EST LA SUPERCLASSE DES PRODUITS ET DES !!!!! -- */
  4. /* -- !!!!! SERVICES   ET DES MARCHANDISES                   !!!!! --*/
  5. namespace App\Entity;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Doctrine\ORM\Mapping\Column;
  10. use Doctrine\ORM\Mapping\Entity;
  11. use Doctrine\ORM\Mapping\Table;
  12. use Symfony\Component\Serializer\Annotation\Groups;
  13. #[ORM\Table(name'marchandise')]
  14. #[ORM\Entity(repositoryClass'App\Repository\MarchandiseRepository')]
  15. class Marchandise extends Product
  16. {
  17.     #[ORM\Column(name'packaging'type'string'length255nullabletrue)]
  18.     #[Groups(['company'])]
  19.     protected $packaging//marchandise
  20.     #[ORM\Column(name'quantity'type'integer'nullabletrue)]
  21.     #[Groups(['company'])]
  22.     protected $quantity//marchandise
  23.     #[ORM\Column(name'weight'type'integer'nullabletrue)]
  24.     #[Groups(['company'])]
  25.     protected $weight//marchandise
  26.      #[ORM\Column(name'weightunit'type'string'length:255nullabletrue )]
  27.      #[Groups(['company'])]
  28.     protected $weightunit//marchandise
  29.     #[ORM\Column(name'volume'type'integer'nullabletrue)]
  30.     #[Groups(['company'])]
  31.     protected $volume//marchandise
  32.      #[ORM\Column(name'volumeunit'type'string'length255nullabletrue)]
  33.      #[Groups(['company'])]
  34.     protected $volumeunit//marchandise
  35.     #[ORM\Column(name'height'type'integer'nullabletrue)]
  36.     #[Groups(['company'])]
  37.     protected $height//marchandise
  38.     #[ORM\Column(name'width'type'integer'nullabletrue)]
  39.     #[Groups(['company'])]
  40.     protected $width//marchandise
  41.     #[ORM\Column(name'depth'type'integer'nullabletrue)]
  42.     #[Groups(['company'])]
  43.     protected $depth//marchandise
  44.     #[ORM\Column(name'lengthunit'type'string'length255,nullabletrue)]
  45.     #[Groups(['company'])]
  46.     protected $lengthunit;
  47.     #[ORM\Columntype'string'length20,nullabletrue)]
  48.     #[Groups(['company'])]
  49.     private $sellType;
  50.     #[ORM\OneToMany(mappedBy'Marchandise'targetEntitySize::class, orphanRemovaltrue)]
  51.     #[Groups(['company'])]
  52.     private Collection $sizes;
  53.     public function __construct()
  54.     {
  55.         parent::__construct();
  56.         $this->sizes = new ArrayCollection();
  57.     }
  58.     /**
  59.      * @return string
  60.      */
  61.     public function getPackaging()
  62.     {
  63.         return $this->packaging;
  64.     }
  65.     /**
  66.      * @param string $packaging
  67.      */
  68.     public function setPackaging($packaging)
  69.     {
  70.         $this->packaging $packaging;
  71.     }
  72.     /**
  73.      * @return string
  74.      */
  75.     public function getQuantity()
  76.     {
  77.         return $this->quantity;
  78.     }
  79.     /**
  80.      * @param string $quantity
  81.      */
  82.     public function setQuantity($quantity)
  83.     {
  84.         $this->quantity $quantity;
  85.     }
  86.     /**
  87.      * @return string
  88.      */
  89.     public function getWeight()
  90.     {
  91.         return $this->weight;
  92.     }
  93.     /**
  94.      * @param string $weight
  95.      */
  96.     public function setWeight($weight)
  97.     {
  98.         $this->weight $weight;
  99.     }
  100.     /**
  101.      * @return string
  102.      */
  103.     public function getWeightUnit()
  104.     {
  105.         return $this->weightunit;
  106.     }
  107.     /**
  108.      * @param string $weightunit
  109.      */
  110.     public function setWeightUnit($weightunit)
  111.     {
  112.         $this->weightunit $weightunit;
  113.     }
  114.     /**
  115.      * @return string
  116.      */
  117.     public function getVolume()
  118.     {
  119.         return $this->volume;
  120.     }
  121.     /**
  122.      * @param string $volume
  123.      */
  124.     public function setVolume($volume)
  125.     {
  126.         $this->volume $volume;
  127.     }
  128.     /**
  129.      * @return string
  130.      */
  131.     public function getVolumeUnit()
  132.     {
  133.         return $this->volumeunit;
  134.     }
  135.     /**
  136.      * @param string $volumeunit
  137.      */
  138.     public function setVolumeUnit($volumeunit)
  139.     {
  140.         $this->volumeunit $volumeunit;
  141.     }
  142.     /**
  143.      * @return string
  144.      */
  145.     public function getHeight()
  146.     {
  147.         return $this->height;
  148.     }
  149.     /**
  150.      * @param string $height
  151.      */
  152.     public function setHeight($height)
  153.     {
  154.         $this->height $height;
  155.     }
  156.     /**
  157.      * @return string
  158.      */
  159.     public function getWidth()
  160.     {
  161.         return $this->width;
  162.     }
  163.     /**
  164.      * @param string $width
  165.      */
  166.     public function setWidth($width)
  167.     {
  168.         $this->width $width;
  169.     }
  170.     /**
  171.      * @return string
  172.      */
  173.     public function getDepth()
  174.     {
  175.         return $this->depth;
  176.     }
  177.     /**
  178.      * @param string $depth
  179.      */
  180.     public function setDepth($depth)
  181.     {
  182.         $this->depth $depth;
  183.     }
  184.     /**
  185.      * @return string
  186.      */
  187.     public function getLengthUnit()
  188.     {
  189.         return $this->lengthunit;
  190.     }
  191.     /**
  192.      * @param string $lengthunit
  193.      */
  194.     public function setLengthUnit($lengthunit)
  195.     {
  196.         $this->lengthunit $lengthunit;
  197.     }
  198.     public function getSellType(): ?string
  199.     {
  200.         return $this->sellType;
  201.     }
  202.     public function setSellType(?string $sellType): self
  203.     {
  204.         $this->sellType $sellType;
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return Collection<int, Size>
  209.      */
  210.     public function getSizes(): Collection
  211.     {
  212.         return $this->sizes;
  213.     }
  214.     public function addSize(Size $size): static
  215.     {
  216.         if (!$this->sizes->contains($size)) {
  217.             $this->sizes->add($size);
  218.             $size->setMarchandise($this);
  219.         }
  220.         return $this;
  221.     }
  222.     public function removeSize(Size $size): static
  223.     {
  224.         if ($this->sizes->removeElement($size)) {
  225.             // set the owning side to null (unless already changed)
  226.             if ($size->getMarchandise() === $this) {
  227.                 $size->setMarchandise(null);
  228.             }
  229.         }
  230.         return $this;
  231.     }
  232. }