News.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use App\Entity\Hub;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Lc\ShopBundle\Context\FilterMerchantInterface;
  6. use Lc\ShopBundle\Model\AbstractDocumentEntity;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9. * @ORM\MappedSuperclass()
  10. */
  11. abstract class News extends AbstractDocumentEntity implements FilterMerchantInterface
  12. {
  13. /**
  14. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="news")
  15. * @ORM\JoinColumn(nullable=false)
  16. */
  17. protected $merchant;
  18. /**
  19. * @ORM\Column(type="datetime")
  20. * @Gedmo\Timestampable(on="create")
  21. */
  22. protected $date;
  23. /**
  24. * @ORM\Column(type="boolean", nullable=true)
  25. */
  26. protected $isSent;
  27. public function getDate(): ?\DateTimeInterface
  28. {
  29. return $this->date;
  30. }
  31. public function setDate(\DateTimeInterface $date): self
  32. {
  33. $this->date = $date;
  34. return $this;
  35. }
  36. public function getMerchant(): ?Hub
  37. {
  38. return $this->merchant;
  39. }
  40. public function setMerchant(?Hub $merchant): self
  41. {
  42. $this->merchant = $merchant;
  43. return $this;
  44. }
  45. public function getIsSent(): ?bool
  46. {
  47. return $this->isSent;
  48. }
  49. public function setIsSent(?bool $isSent): self
  50. {
  51. $this->isSent = $isSent;
  52. return $this;
  53. }
  54. }