<?php
/* -- !!!!! CETTE CLASSE CORRESPOND AUX PRODUITS ET LA CLASSE !!!!! -- */
/* -- !!!!! "Product" EST LA SUPERCLASSE DES PRODUITS ET DES !!!!! -- */
/* -- !!!!! SERVICES ET DES MARCHANDISES !!!!! --*/
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Table;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Table(name: 'marchandise')]
#[ORM\Entity(repositoryClass: 'App\Repository\MarchandiseRepository')]
class Marchandise extends Product
{
#[ORM\Column(name: 'packaging', type: 'string', length: 255, nullable: true)]
#[Groups(['company'])]
protected $packaging; //marchandise
#[ORM\Column(name: 'quantity', type: 'integer', nullable: true)]
#[Groups(['company'])]
protected $quantity; //marchandise
#[ORM\Column(name: 'weight', type: 'integer', nullable: true)]
#[Groups(['company'])]
protected $weight; //marchandise
#[ORM\Column(name: 'weightunit', type: 'string', length:255, nullable: true )]
#[Groups(['company'])]
protected $weightunit; //marchandise
#[ORM\Column(name: 'volume', type: 'integer', nullable: true)]
#[Groups(['company'])]
protected $volume; //marchandise
#[ORM\Column(name: 'volumeunit', type: 'string', length: 255, nullable: true)]
#[Groups(['company'])]
protected $volumeunit; //marchandise
#[ORM\Column(name: 'height', type: 'integer', nullable: true)]
#[Groups(['company'])]
protected $height; //marchandise
#[ORM\Column(name: 'width', type: 'integer', nullable: true)]
#[Groups(['company'])]
protected $width; //marchandise
#[ORM\Column(name: 'depth', type: 'integer', nullable: true)]
#[Groups(['company'])]
protected $depth; //marchandise
#[ORM\Column(name: 'lengthunit', type: 'string', length: 255,nullable: true)]
#[Groups(['company'])]
protected $lengthunit;
#[ORM\Column( type: 'string', length: 20,nullable: true)]
#[Groups(['company'])]
private $sellType;
#[ORM\OneToMany(mappedBy: 'Marchandise', targetEntity: Size::class, orphanRemoval: true)]
#[Groups(['company'])]
private Collection $sizes;
public function __construct()
{
parent::__construct();
$this->sizes = new ArrayCollection();
}
/**
* @return string
*/
public function getPackaging()
{
return $this->packaging;
}
/**
* @param string $packaging
*/
public function setPackaging($packaging)
{
$this->packaging = $packaging;
}
/**
* @return string
*/
public function getQuantity()
{
return $this->quantity;
}
/**
* @param string $quantity
*/
public function setQuantity($quantity)
{
$this->quantity = $quantity;
}
/**
* @return string
*/
public function getWeight()
{
return $this->weight;
}
/**
* @param string $weight
*/
public function setWeight($weight)
{
$this->weight = $weight;
}
/**
* @return string
*/
public function getWeightUnit()
{
return $this->weightunit;
}
/**
* @param string $weightunit
*/
public function setWeightUnit($weightunit)
{
$this->weightunit = $weightunit;
}
/**
* @return string
*/
public function getVolume()
{
return $this->volume;
}
/**
* @param string $volume
*/
public function setVolume($volume)
{
$this->volume = $volume;
}
/**
* @return string
*/
public function getVolumeUnit()
{
return $this->volumeunit;
}
/**
* @param string $volumeunit
*/
public function setVolumeUnit($volumeunit)
{
$this->volumeunit = $volumeunit;
}
/**
* @return string
*/
public function getHeight()
{
return $this->height;
}
/**
* @param string $height
*/
public function setHeight($height)
{
$this->height = $height;
}
/**
* @return string
*/
public function getWidth()
{
return $this->width;
}
/**
* @param string $width
*/
public function setWidth($width)
{
$this->width = $width;
}
/**
* @return string
*/
public function getDepth()
{
return $this->depth;
}
/**
* @param string $depth
*/
public function setDepth($depth)
{
$this->depth = $depth;
}
/**
* @return string
*/
public function getLengthUnit()
{
return $this->lengthunit;
}
/**
* @param string $lengthunit
*/
public function setLengthUnit($lengthunit)
{
$this->lengthunit = $lengthunit;
}
public function getSellType(): ?string
{
return $this->sellType;
}
public function setSellType(?string $sellType): self
{
$this->sellType = $sellType;
return $this;
}
/**
* @return Collection<int, Size>
*/
public function getSizes(): Collection
{
return $this->sizes;
}
public function addSize(Size $size): static
{
if (!$this->sizes->contains($size)) {
$this->sizes->add($size);
$size->setMarchandise($this);
}
return $this;
}
public function removeSize(Size $size): static
{
if ($this->sizes->removeElement($size)) {
// set the owning side to null (unless already changed)
if ($size->getMarchandise() === $this) {
$size->setMarchandise(null);
}
}
return $this;
}
}