<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* CubaCustomsItem
*
* @ORM\Table(name="cuba_customs_item", indexes={@ORM\Index(name="FKcuba_custo273005", columns={"cuba_customs_category_id"})})
* @ORM\Entity()
*/
class CubaCustomsItem
{
/**
* @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 int
*
* @ORM\Column(name="max_quantity", type="integer", nullable=false)
*/
private $maxQuantity;
/**
* @var int
*
* @ORM\Column(name="custom_point", type="integer", nullable=false)
*/
private $customPoint;
/**
* @var CubaCustomsCategory
*
* @ORM\ManyToOne(targetEntity="CubaCustomsCategory")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="cuba_customs_category_id", referencedColumnName="id")
* })
*/
private $cubaCustomsCategory;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $maxQuantityMetricUnit;
/**
* @var metricUnit
*
* @ORM\ManyToOne(targetEntity="MetricUnit")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="metric_unit", referencedColumnName="id")
* })
*/
private $metricUnit;
/**
* @ORM\OneToMany(targetEntity=TariffFraction::class, mappedBy="cubaCustomsItem")
*/
private $tariffFractions;
/**
* @ORM\OneToMany(targetEntity=Item::class, mappedBy="cubaCustomsItem")
*/
private $items;
public function __construct()
{
$this->tariffFractions = new ArrayCollection();
$this->items = 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 getMaxQuantity(): ?int
{
return $this->maxQuantity;
}
public function setMaxQuantity(int $maxQuantity): self
{
$this->maxQuantity = $maxQuantity;
return $this;
}
public function getCustomPoint(): ?int
{
return $this->customPoint;
}
public function setCustomPoint(int $customPoint): self
{
$this->customPoint = $customPoint;
return $this;
}
public function getMaxQuantityMetricUnit(): ?float
{
return $this->maxQuantityMetricUnit;
}
public function setMaxQuantityMetricUnit(?float $maxQuantityMetricUnit): self
{
$this->maxQuantityMetricUnit = $maxQuantityMetricUnit;
return $this;
}
public function getMetricUnit(): ?MetricUnit
{
return $this->metricUnit;
}
public function setMetricUnit(?MetricUnit $metricUnit): self
{
$this->metricUnit = $metricUnit;
return $this;
}
public function getCubaCustomsCategory(): ?CubaCustomsCategory
{
return $this->cubaCustomsCategory;
}
public function setCubaCustomsCategory(?CubaCustomsCategory $cubaCustomsCategory): self
{
$this->cubaCustomsCategory = $cubaCustomsCategory;
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @return Collection<int, TariffFraction>
*/
public function getTariffFractions(): Collection
{
return $this->tariffFractions;
}
public function addTariffFraction(TariffFraction $tariffFraction): self
{
if (!$this->tariffFractions->contains($tariffFraction)) {
$this->tariffFractions[] = $tariffFraction;
$tariffFraction->setCubaCustomsItem($this);
}
return $this;
}
public function removeTariffFraction(TariffFraction $tariffFraction): self
{
if ($this->tariffFractions->removeElement($tariffFraction)) {
// set the owning side to null (unless already changed)
if ($tariffFraction->getCubaCustomsItem() === $this) {
$tariffFraction->setCubaCustomsItem(null);
}
}
return $this;
}
/**
* @return Collection<int, Item>
*/
public function getItems(): Collection
{
return $this->items;
}
public function addItem(Item $item): self
{
if (!$this->items->contains($item)) {
$this->items[] = $item;
$item->setCubaCustomsItem($this);
}
return $this;
}
public function removeItem(Item $item): self
{
if ($this->items->removeElement($item)) {
// set the owning side to null (unless already changed)
if ($item->getCubaCustomsItem() === $this) {
$item->setCubaCustomsItem(null);
}
}
return $this;
}
}