Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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