AccessFictionalIntangible.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Billing;
  4. use App\Entity\Access\Access;
  5. use App\Entity\Access\AccessFamily;
  6. use App\Entity\Product\FictionalIntangible;
  7. //use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Doctrine\Common\Collections\Collection;
  11. /**
  12. * Classe ... qui ...
  13. */
  14. //#[Auditable]
  15. #[ORM\Entity]
  16. class AccessFictionalIntangible
  17. {
  18. #[ORM\Id]
  19. #[ORM\Column]
  20. #[ORM\GeneratedValue]
  21. private ?int $id = null;
  22. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'accessFictionalIntangibles')]
  23. private Access $access;
  24. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'accessFictionalIntangibles')]
  25. private AccessFamily $accessFamily;
  26. #[ORM\ManyToOne]
  27. #[ORM\JoinColumn(nullable: false)]
  28. private FictionalIntangible $fictionalIntangible;
  29. #[ORM\OneToMany(mappedBy: 'accessFictionalIntangible', targetEntity: BillingIntangibleExcludeDate::class, cascade: ['persist'], orphanRemoval: true, )]
  30. private Collection $billingIntangibleExcludeDates;
  31. public function __construct()
  32. {
  33. $this->billingIntangibleExcludeDates = new ArrayCollection();
  34. }
  35. public function getId(): ?int
  36. {
  37. return $this->id;
  38. }
  39. public function getAccess(): ?Access
  40. {
  41. return $this->access;
  42. }
  43. public function setAccess(?Access $access): self
  44. {
  45. $this->access = $access;
  46. return $this;
  47. }
  48. public function getAccessFamily(): ?AccessFamily
  49. {
  50. return $this->accessFamily;
  51. }
  52. public function setAccessFamily(?AccessFamily $accessFamily): self
  53. {
  54. $this->accessFamily = $accessFamily;
  55. return $this;
  56. }
  57. public function getFictionalIntangible(): ?FictionalIntangible
  58. {
  59. return $this->fictionalIntangible;
  60. }
  61. public function setFictionalIntangible(?FictionalIntangible $fictionalIntangible): self
  62. {
  63. $this->fictionalIntangible = $fictionalIntangible;
  64. return $this;
  65. }
  66. /**
  67. * @return Collection<int, BillingIntangibleExcludeDate>
  68. */
  69. public function getBillingIntangibleExcludeDates(): Collection
  70. {
  71. return $this->billingIntangibleExcludeDates;
  72. }
  73. public function addBillingIntangibleExcludeDate(BillingIntangibleExcludeDate $billingIntangibleExcludeDate): self
  74. {
  75. if (!$this->billingIntangibleExcludeDates->contains($billingIntangibleExcludeDate)) {
  76. $this->billingIntangibleExcludeDates[] = $billingIntangibleExcludeDate;
  77. $billingIntangibleExcludeDate->setAccessFictionalIntangible($this);
  78. }
  79. return $this;
  80. }
  81. public function removeBillingIntangibleExcludeDate(BillingIntangibleExcludeDate $billingIntangibleExcludeDate): self
  82. {
  83. if ($this->billingIntangibleExcludeDates->removeElement($billingIntangibleExcludeDate)) {
  84. // set the owning side to null (unless already changed)
  85. if ($billingIntangibleExcludeDate->getAccessFictionalIntangible() === $this) {
  86. $billingIntangibleExcludeDate->setAccessFictionalIntangible(null);
  87. }
  88. }
  89. return $this;
  90. }
  91. }