<?php
namespace App\Entity;
use App\Entity\Documentation\HouseGuideBox;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Box
*
* @ORM\Table(name="box")
* @ORM\Entity()
*/
class Box
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var float
*
* @ORM\Column(name="length", type="float", precision=10, scale=0, nullable=false)
*/
private $length;
/**
* @var float
*
* @ORM\Column(name="width", type="float", precision=10, scale=0, nullable=false)
*/
private $width;
/**
* @var float
*
* @ORM\Column(name="height", type="float", precision=10, scale=0, nullable=false)
*/
private $height;
/**
* @var float
*
* @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false)
*/
private $weight;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Item", inversedBy="box", cascade={"remove"})
* @ORM\JoinTable(name="box_item",
* joinColumns={
* @ORM\JoinColumn(name="box_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="item_id", referencedColumnName="id")
* }
* )
*/
private $item = array();
/**
* @ORM\ManyToMany(targetEntity=Shipping::class, mappedBy="box", cascade={"persist"})
*/
private $shipping;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $label;
/**
* @ORM\Column(type="string", length=255)
*/
private $packingName;
/**
* @ORM\Column(type="float")
*/
private $price;
/**
* @ORM\Column(type="float")
*/
private $priceByKG;
/**
* @ORM\Column(type="boolean")
*/
private $isCustom;
/**
* @ORM\OneToMany(targetEntity=HouseGuideBox::class, mappedBy="box")
*/
private $houseGuideBoxes;
/**
* Constructor
*/
public function __construct()
{
$this->item = new \Doctrine\Common\Collections\ArrayCollection();
$this->shipping = new ArrayCollection();
$this->houseGuideBoxes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLength(): ?float
{
return $this->length;
}
public function setLength(float $length): self
{
$this->length = $length;
return $this;
}
public function getWidth(): ?float
{
return $this->width;
}
public function setWidth(float $width): self
{
$this->width = $width;
return $this;
}
public function getHeight(): ?float
{
return $this->height;
}
public function setHeight(float $height): self
{
$this->height = $height;
return $this;
}
public function getWeight(): ?float
{
return $this->weight;
}
public function setWeight(float $weight): self
{
$this->weight = $weight;
return $this;
}
/**
* @return Collection<int, Item>
*/
public function getItem(): Collection
{
return $this->item;
}
public function addItem(Item $item): self
{
if (!$this->item->contains($item)) {
$this->item[] = $item;
}
return $this;
}
public function removeItem(Item $item): self
{
$this->item->removeElement($item);
return $this;
}
/**
* @return Collection<int, Shipping>
*/
public function getShipping(): Collection
{
return $this->shipping;
}
public function addShipping(Shipping $shipping): self
{
if (!$this->shipping->contains($shipping)) {
$this->shipping[] = $shipping;
$shipping->addBox($this);
}
return $this;
}
public function removeShipping(Shipping $shipping): self
{
if ($this->shipping->removeElement($shipping)) {
$shipping->removeBox($this);
}
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getPackingName(): ?string
{
return $this->packingName;
}
public function setPackingName(string $packingName): self
{
$this->packingName = $packingName;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getPriceByKG(): ?float
{
return $this->priceByKG;
}
public function setPriceByKG(float $priceByKG): self
{
$this->priceByKG = $priceByKG;
return $this;
}
public function isIsCustom(): ?bool
{
return $this->isCustom;
}
public function setIsCustom(bool $isCustom): self
{
$this->isCustom = $isCustom;
return $this;
}
/**
* @return Collection<int, HouseGuideBox>
*/
public function getHouseGuideBoxes(): Collection
{
return $this->houseGuideBoxes;
}
public function addHouseGuideBox(HouseGuideBox $houseGuideBox): self
{
if (!$this->houseGuideBoxes->contains($houseGuideBox)) {
$this->houseGuideBoxes[] = $houseGuideBox;
$houseGuideBox->setBox($this);
}
return $this;
}
public function removeHouseGuideBox(HouseGuideBox $houseGuideBox): self
{
if ($this->houseGuideBoxes->removeElement($houseGuideBox)) {
// set the owning side to null (unless already changed)
if ($houseGuideBox->getBox() === $this) {
$houseGuideBox->setBox(null);
}
}
return $this;
}
}