<?php
namespace App\Entity\Gauge;
use App\Entity\Extension\GaugeUnitInterface;
use App\Entity\Extension\HistoricalInterface;
use App\Entity\Extension\HistoricalTrait;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\Gauge\GaugeInvoiceUnitRepository;
/**
* @ORM\Entity(repositoryClass=GaugeInvoiceUnitRepository::class)
* @ORM\Table(name="gauge_invoice_unit")
*/
class GaugeInvoiceUnit implements HistoricalInterface, GaugeUnitInterface
{
use HistoricalTrait;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @var Gauge $gauge
* @ORM\ManyToOne(targetEntity="App\Entity\Gauge\Gauge", inversedBy="invoiceUnits")
* @ORM\JoinColumn(name="gauge_id", referencedColumnName="id", nullable=false)
*/
private Gauge $gauge;
/**
* value from App\Utils\Units.php e.g. Units::M3_VALUE...
* @ORM\Column(type="smallint")
*/
private int $unit;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
* @return GaugeInvoiceUnit
*/
public function setId(int $id): GaugeInvoiceUnit
{
$this->id = $id;
return $this;
}
/**
* @return Gauge
*/
public function getGauge(): Gauge
{
return $this->gauge;
}
/**
* @param Gauge $gauge
* @return GaugeInvoiceUnit
*/
public function setGauge(Gauge $gauge): GaugeInvoiceUnit
{
$this->gauge = $gauge;
return $this;
}
/**
* @return int
*/
public function getUnit(): int
{
return $this->unit;
}
/**
* @param int $unit
* @return GaugeInvoiceUnit
*/
public function setUnit(int $unit): GaugeInvoiceUnit
{
$this->unit = $unit;
return $this;
}
}