FamilyQuotientBand.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Billing;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use App\Entity\Product\IntangibleDiscountDetail;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ApiResource(operations: [])]
  9. #[ORM\Entity]
  10. class FamilyQuotientBand
  11. {
  12. #[ORM\Id]
  13. #[ORM\Column]
  14. #[ORM\GeneratedValue]
  15. private int $id;
  16. #[ORM\ManyToOne(targetEntity: FamilyQuotientModel::class, cascade: [], inversedBy: 'familyQuotientBands')]
  17. #[ORM\JoinColumn(nullable: false)]
  18. protected mixed $familyQuotientModel;
  19. #[ORM\OneToMany(
  20. mappedBy: 'familyQuotientBand',
  21. targetEntity: FamilyQuotientBandDetail::class,
  22. cascade: ['persist'],
  23. orphanRemoval: true,
  24. )]
  25. protected Collection $familyQuotientBandDetails;
  26. #[ORM\OneToMany(mappedBy: 'familyQuotientBand', targetEntity: IntangibleDiscountDetail::class, cascade: [], orphanRemoval: true)]
  27. protected Collection $intangibleDiscountDetails;
  28. public function getId(): int
  29. {
  30. return $this->id;
  31. }
  32. public function setId(int $id): self
  33. {
  34. $this->id = $id;
  35. return $this;
  36. }
  37. public function getFamilyQuotientModel(): mixed
  38. {
  39. return $this->familyQuotientModel;
  40. }
  41. public function setFamilyQuotientModel(mixed $familyQuotientModel): self
  42. {
  43. $this->familyQuotientModel = $familyQuotientModel;
  44. return $this;
  45. }
  46. public function getFamilyQuotientBandDetails(): Collection
  47. {
  48. return $this->familyQuotientBandDetails;
  49. }
  50. public function addFamilyQuotientBandDetail(FamilyQuotientBandDetail $familyQuotientBandDetail): self
  51. {
  52. if (!$this->familyQuotientBandDetails->contains($familyQuotientBandDetail)) {
  53. $this->familyQuotientBandDetails[] = $familyQuotientBandDetail;
  54. $familyQuotientBandDetail->setFamilyQuotientBand($this);
  55. }
  56. return $this;
  57. }
  58. public function removeFamilyQuotientBandDetail(FamilyQuotientBandDetail $familyQuotientBandDetail): self
  59. {
  60. if ($this->familyQuotientBandDetails->removeElement($familyQuotientBandDetail)) {
  61. $familyQuotientBandDetail->setFamilyQuotientBand(null);
  62. }
  63. return $this;
  64. }
  65. public function getIntangibleDiscountDetails(): Collection
  66. {
  67. return $this->intangibleDiscountDetails;
  68. }
  69. public function addIntangibleDiscountDetail(IntangibleDiscountDetail $intangibleDiscountDetail): self
  70. {
  71. if (!$this->intangibleDiscountDetails->contains($intangibleDiscountDetail)) {
  72. $this->intangibleDiscountDetails[] = $intangibleDiscountDetail;
  73. $intangibleDiscountDetail->setFamilyQuotientBand($this);
  74. }
  75. return $this;
  76. }
  77. public function removeIntangibleDiscountDetail(IntangibleDiscountDetail $intangibleDiscountDetail): self
  78. {
  79. $this->intangibleDiscountDetails->removeElement($intangibleDiscountDetail);
  80. return $this;
  81. }
  82. }