You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
3.5KB

  1. <?php
  2. namespace Lc\SovBundle\Model\Reminder;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Lc\SovBundle\Doctrine\EntityInterface;
  7. use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
  8. use Lc\SovBundle\Model\User\UserInterface;
  9. /**
  10. * @ORM\MappedSuperclass()
  11. */
  12. abstract class ReminderModel extends AbstractLightEntity implements ReminderInterface, EntityInterface
  13. {
  14. /**
  15. * temporary fields (do not delete)
  16. */
  17. protected $relatedPage;
  18. /**
  19. * @ORM\Column(type="string", length=255)
  20. */
  21. protected $title;
  22. /**
  23. * @ORM\Column(type="text", nullable=true)
  24. */
  25. protected $description;
  26. /**
  27. * @ORM\Column(type="string", length=64, nullable=true)
  28. */
  29. protected $crudAction;
  30. /**
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. */
  33. protected $crudControllerFqcn;
  34. /**
  35. * @ORM\Column(type="integer", nullable=true)
  36. */
  37. protected $entityId;
  38. /**
  39. * @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface")
  40. */
  41. protected $users;
  42. /**
  43. * @ORM\Column(type="date", nullable=true)
  44. */
  45. protected $dateReminder;
  46. /**
  47. * @ORM\Column(type="boolean", nullable=false)
  48. */
  49. protected $done;
  50. public function __construct()
  51. {
  52. $this->users = new ArrayCollection();
  53. $this->done = false;
  54. }
  55. public function getTitle(): ?string
  56. {
  57. return $this->title;
  58. }
  59. public function setTitle(string $title): self
  60. {
  61. $this->title = $title;
  62. return $this;
  63. }
  64. public function getDescription(): ?string
  65. {
  66. return $this->description;
  67. }
  68. public function setDescription(?string $description): self
  69. {
  70. $this->description = $description;
  71. return $this;
  72. }
  73. public function getCrudAction(): ?string
  74. {
  75. return $this->crudAction;
  76. }
  77. public function setCrudAction(?string $crudAction): self
  78. {
  79. $this->crudAction = $crudAction;
  80. return $this;
  81. }
  82. public function getCrudControllerFqcn(): ?string
  83. {
  84. return $this->crudControllerFqcn;
  85. }
  86. public function setCrudControllerFqcn(?string $crudControllerFqcn): self
  87. {
  88. $this->crudControllerFqcn = $crudControllerFqcn;
  89. return $this;
  90. }
  91. public function getEntityId(): ?int
  92. {
  93. return $this->entityId;
  94. }
  95. public function setEntityId(?int $entityId): self
  96. {
  97. $this->entityId = $entityId;
  98. return $this;
  99. }
  100. /**
  101. * @return Collection|UserInterface[]
  102. */
  103. public function getUsers(): Collection
  104. {
  105. return $this->users;
  106. }
  107. public function addUser(UserInterface $user): self
  108. {
  109. if (!$this->users->contains($user)) {
  110. $this->users[] = $user;
  111. }
  112. return $this;
  113. }
  114. public function removeUser(UserInterface $user): self
  115. {
  116. if ($this->users->contains($user)) {
  117. $this->users->removeElement($user);
  118. }
  119. return $this;
  120. }
  121. public function getDateReminder(): ?\DateTimeInterface
  122. {
  123. return $this->dateReminder;
  124. }
  125. public function setDateReminder(?\DateTimeInterface $dateReminder): self
  126. {
  127. $this->dateReminder = $dateReminder;
  128. return $this;
  129. }
  130. public function getDone(): ?bool
  131. {
  132. return $this->done;
  133. }
  134. public function setDone(?bool $done): self
  135. {
  136. $this->done = $done;
  137. return $this;
  138. }
  139. }