Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

160 lines
3.4KB

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