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.

197 line
3.9KB

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