src/Entity/Gauge/GaugeInvoiceUnit.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gauge;
  3. use App\Entity\Extension\GaugeUnitInterface;
  4. use App\Entity\Extension\HistoricalInterface;
  5. use App\Entity\Extension\HistoricalTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Repository\Gauge\GaugeInvoiceUnitRepository;
  8. /**
  9. * @ORM\Entity(repositoryClass=GaugeInvoiceUnitRepository::class)
  10. * @ORM\Table(name="gauge_invoice_unit")
  11. */
  12. class GaugeInvoiceUnit implements HistoricalInterface, GaugeUnitInterface
  13. {
  14. use HistoricalTrait;
  15. /**
  16. * @ORM\Id()
  17. * @ORM\GeneratedValue()
  18. * @ORM\Column(type="integer")
  19. */
  20. private int $id;
  21. /**
  22. * @var Gauge $gauge
  23. * @ORM\ManyToOne(targetEntity="App\Entity\Gauge\Gauge", inversedBy="invoiceUnits")
  24. * @ORM\JoinColumn(name="gauge_id", referencedColumnName="id", nullable=false)
  25. */
  26. private Gauge $gauge;
  27. /**
  28. * value from App\Utils\Units.php e.g. Units::M3_VALUE...
  29. * @ORM\Column(type="smallint")
  30. */
  31. private int $unit;
  32. /**
  33. * @return int
  34. */
  35. public function getId(): int
  36. {
  37. return $this->id;
  38. }
  39. /**
  40. * @param int $id
  41. * @return GaugeInvoiceUnit
  42. */
  43. public function setId(int $id): GaugeInvoiceUnit
  44. {
  45. $this->id = $id;
  46. return $this;
  47. }
  48. /**
  49. * @return Gauge
  50. */
  51. public function getGauge(): Gauge
  52. {
  53. return $this->gauge;
  54. }
  55. /**
  56. * @param Gauge $gauge
  57. * @return GaugeInvoiceUnit
  58. */
  59. public function setGauge(Gauge $gauge): GaugeInvoiceUnit
  60. {
  61. $this->gauge = $gauge;
  62. return $this;
  63. }
  64. /**
  65. * @return int
  66. */
  67. public function getUnit(): int
  68. {
  69. return $this->unit;
  70. }
  71. /**
  72. * @param int $unit
  73. * @return GaugeInvoiceUnit
  74. */
  75. public function setUnit(int $unit): GaugeInvoiceUnit
  76. {
  77. $this->unit = $unit;
  78. return $this;
  79. }
  80. }