選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

194 行
4.3KB

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