<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Storage
*
* @ORM\Table(name="storage", uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"})})
* @ORM\Entity()
*/
class Storage
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
/**
* @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="total_volume", type="float", precision=10, scale=0, nullable=false)
*/
private $totalVolume;
/**
* @var float
*
* @ORM\Column(name="maximum_weight", type="float", precision=10, scale=0, nullable=false)
*/
private $maximumWeight;
/**
* @ORM\OneToMany(targetEntity=Shelving::class, mappedBy="storage")
*/
private $shelvings;
public function __construct()
{
$this->shelvings = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
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 getTotalVolume(): ?float
{
return $this->totalVolume;
}
public function setTotalVolume(float $totalVolume): self
{
$this->totalVolume = $totalVolume;
return $this;
}
public function getMaximumWeight(): ?float
{
return $this->maximumWeight;
}
public function setMaximumWeight(float $maximumWeight): self
{
$this->maximumWeight = $maximumWeight;
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @return Collection<int, Shelving>
*/
public function getShelvings(): Collection
{
return $this->shelvings;
}
public function addShelving(Shelving $shelving): self
{
if (!$this->shelvings->contains($shelving)) {
$this->shelvings[] = $shelving;
$shelving->setStorage($this);
}
return $this;
}
public function removeShelving(Shelving $shelving): self
{
if ($this->shelvings->removeElement($shelving)) {
// set the owning side to null (unless already changed)
if ($shelving->getStorage() === $this) {
$shelving->setStorage(null);
}
}
return $this;
}
}