src/Finance/Domain/Entity/FeeDefinition.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Finance\Domain\Entity;
  3. use App\Entity\SchoolYear;
  4. use App\Entity\Level;
  5. use App\Finance\Domain\Enum\FeeType;
  6. use App\Finance\Domain\Repository\FeeDefinitionRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass: FeeDefinitionRepository::class)]
  9. #[ORM\Table(name: 'fee_definitions')]
  10. class FeeDefinition
  11. {
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue]
  14. #[ORM\Column]
  15. private ?int $id = null;
  16. #[ORM\Column(enumType: FeeType::class)]
  17. private FeeType $feeType;
  18. #[ORM\Column(length: 255)]
  19. private string $label;
  20. #[ORM\Column(type: 'text', nullable: true)]
  21. private ?string $description = null;
  22. #[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
  23. private float $amount;
  24. #[ORM\ManyToOne(targetEntity: SchoolYear::class)]
  25. #[ORM\JoinColumn(nullable: false)]
  26. private SchoolYear $schoolYear;
  27. #[ORM\ManyToOne(targetEntity: Level::class)]
  28. #[ORM\JoinColumn(nullable: true)]
  29. private ?Level $level = null;
  30. #[ORM\Column(type: 'date', nullable: true)]
  31. private ?\DateTimeInterface $dueDate = null;
  32. #[ORM\Column(type: 'integer', nullable: true)]
  33. private ?int $installments = null;
  34. #[ORM\Column]
  35. private bool $isActive = true;
  36. #[ORM\Column]
  37. private \DateTimeImmutable $createdAt;
  38. #[ORM\Column]
  39. private \DateTimeImmutable $updatedAt;
  40. public function __construct()
  41. {
  42. $this->createdAt = new \DateTimeImmutable();
  43. $this->updatedAt = new \DateTimeImmutable();
  44. }
  45. public function getId(): ?int
  46. {
  47. return $this->id;
  48. }
  49. public function getFeeType(): FeeType
  50. {
  51. return $this->feeType;
  52. }
  53. public function setFeeType(FeeType $feeType): self
  54. {
  55. $this->feeType = $feeType;
  56. $this->updatedAt = new \DateTimeImmutable();
  57. return $this;
  58. }
  59. public function getLabel(): string
  60. {
  61. return $this->label;
  62. }
  63. public function setLabel(string $label): self
  64. {
  65. $this->label = $label;
  66. $this->updatedAt = new \DateTimeImmutable();
  67. return $this;
  68. }
  69. public function getAmount(): float
  70. {
  71. return (float) $this->amount;
  72. }
  73. public function setAmount(float $amount): self
  74. {
  75. $this->amount = $amount;
  76. $this->updatedAt = new \DateTimeImmutable();
  77. return $this;
  78. }
  79. public function getSchoolYear(): SchoolYear
  80. {
  81. return $this->schoolYear;
  82. }
  83. public function setSchoolYear(SchoolYear $schoolYear): self
  84. {
  85. $this->schoolYear = $schoolYear;
  86. $this->updatedAt = new \DateTimeImmutable();
  87. return $this;
  88. }
  89. public function getLevel(): ?Level
  90. {
  91. return $this->level;
  92. }
  93. public function setLevel(?Level $level): self
  94. {
  95. $this->level = $level;
  96. $this->updatedAt = new \DateTimeImmutable();
  97. return $this;
  98. }
  99. public function getDueDate(): ?\DateTimeInterface
  100. {
  101. return $this->dueDate;
  102. }
  103. public function setDueDate(?\DateTimeInterface $dueDate): self
  104. {
  105. $this->dueDate = $dueDate;
  106. $this->updatedAt = new \DateTimeImmutable();
  107. return $this;
  108. }
  109. public function getInstallments(): ?int
  110. {
  111. return $this->installments;
  112. }
  113. public function setInstallments(?int $installments): self
  114. {
  115. $this->installments = $installments;
  116. $this->updatedAt = new \DateTimeImmutable();
  117. return $this;
  118. }
  119. public function isActive(): bool
  120. {
  121. return $this->isActive;
  122. }
  123. public function setIsActive(bool $isActive): self
  124. {
  125. $this->isActive = $isActive;
  126. $this->updatedAt = new \DateTimeImmutable();
  127. return $this;
  128. }
  129. public function getCreatedAt(): \DateTimeImmutable
  130. {
  131. return $this->createdAt;
  132. }
  133. public function getUpdatedAt(): \DateTimeImmutable
  134. {
  135. return $this->updatedAt;
  136. }
  137. }