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 string $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 getSchoolYear(): SchoolYear
  70. {
  71. return $this->schoolYear;
  72. }
  73. public function setSchoolYear(SchoolYear $schoolYear): self
  74. {
  75. $this->schoolYear = $schoolYear;
  76. $this->updatedAt = new \DateTimeImmutable();
  77. return $this;
  78. }
  79. public function getLevel(): ?Level
  80. {
  81. return $this->level;
  82. }
  83. public function setLevel(?Level $level): self
  84. {
  85. $this->level = $level;
  86. $this->updatedAt = new \DateTimeImmutable();
  87. return $this;
  88. }
  89. public function getDueDate(): ?\DateTimeInterface
  90. {
  91. return $this->dueDate;
  92. }
  93. public function setDueDate(?\DateTimeInterface $dueDate): self
  94. {
  95. $this->dueDate = $dueDate;
  96. $this->updatedAt = new \DateTimeImmutable();
  97. return $this;
  98. }
  99. public function getInstallments(): ?int
  100. {
  101. return $this->installments;
  102. }
  103. public function setInstallments(?int $installments): self
  104. {
  105. $this->installments = $installments;
  106. $this->updatedAt = new \DateTimeImmutable();
  107. return $this;
  108. }
  109. public function isActive(): bool
  110. {
  111. return $this->isActive;
  112. }
  113. public function setIsActive(bool $isActive): self
  114. {
  115. $this->isActive = $isActive;
  116. $this->updatedAt = new \DateTimeImmutable();
  117. return $this;
  118. }
  119. public function getCreatedAt(): \DateTimeImmutable
  120. {
  121. return $this->createdAt;
  122. }
  123. public function getUpdatedAt(): \DateTimeImmutable
  124. {
  125. return $this->updatedAt;
  126. }
  127. public function getAmount(): float
  128. {
  129. return (float) $this->amount;
  130. }
  131. public function setAmount(float $amount): self
  132. {
  133. $this->amount = (string) $amount;
  134. return $this;
  135. }
  136. }