src/Entity/Gauge/GaugeRate.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gauge;
  3. use App\Entity\Extension\HistoricalInterface;
  4. use App\Entity\Extension\HistoricalTrait;
  5. use App\Entity\Rate;
  6. use App\Repository\Gauge\GaugeRateRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12. * @ORM\Entity(repositoryClass=GaugeRateRepository::class)
  13. * @ORM\Table(name="gauge_rate")
  14. */
  15. class GaugeRate implements HistoricalInterface
  16. {
  17. use HistoricalTrait;
  18. /**
  19. * @ORM\Id()
  20. * @ORM\GeneratedValue()
  21. * @ORM\Column(type="integer")
  22. */
  23. private int $id;
  24. /**
  25. * @var Gauge $gauge
  26. * @ORM\ManyToOne(targetEntity="App\Entity\Gauge\Gauge", inversedBy="rates")
  27. * @ORM\JoinColumn(name="gauge_id", referencedColumnName="id", nullable=false)
  28. */
  29. private Gauge $gauge;
  30. /**
  31. * @var Rate $rate
  32. * @ORM\ManyToOne(targetEntity="App\Entity\Rate")
  33. * @ORM\JoinColumn(name="rate_id", referencedColumnName="id", nullable=false)
  34. */
  35. private Rate $rate;
  36. /**
  37. * @return int
  38. */
  39. public function getId(): int
  40. {
  41. return $this->id;
  42. }
  43. /**
  44. * @param int $id
  45. * @return self
  46. */
  47. public function setId(int $id): self
  48. {
  49. $this->id = $id;
  50. return $this;
  51. }
  52. /**
  53. * @return Gauge
  54. */
  55. public function getGauge(): Gauge
  56. {
  57. return $this->gauge;
  58. }
  59. /**
  60. * @param Gauge $gauge
  61. * @return GaugeRate
  62. */
  63. public function setGauge(Gauge $gauge): GaugeRate
  64. {
  65. $this->gauge = $gauge;
  66. return $this;
  67. }
  68. /**
  69. * @return Rate
  70. */
  71. public function getRate(): Rate
  72. {
  73. return $this->rate;
  74. }
  75. /**
  76. * @param Rate $rate
  77. * @return GaugeRate
  78. */
  79. public function setRate(Rate $rate): GaugeRate
  80. {
  81. $this->rate = $rate;
  82. return $this;
  83. }
  84. }