News.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. public function getDate(): ?\DateTimeInterface
  24. {
  25. return $this->date;
  26. }
  27. public function setDate(\DateTimeInterface $date): self
  28. {
  29. $this->date = $date;
  30. return $this;
  31. }
  32. public function getMerchant(): ?Hub
  33. {
  34. return $this->merchant;
  35. }
  36. public function setMerchant(?Hub $merchant): self
  37. {
  38. $this->merchant = $merchant;
  39. return $this;
  40. }
  41. }