您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

38 行
698B

  1. <?php
  2. namespace Lc\SovBundle\Model\Site;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. abstract class NewsModel extends AbstractFullEntity implements NewsInterface
  10. {
  11. /**
  12. * @ORM\Column(type="datetime")
  13. * @Gedmo\Timestampable(on="create")
  14. */
  15. protected $date;
  16. public function __toString()
  17. {
  18. return $this->getTitle();
  19. }
  20. public function getDate(): ?\DateTimeInterface
  21. {
  22. return $this->date;
  23. }
  24. public function setDate(\DateTimeInterface $date): self
  25. {
  26. $this->date = $date;
  27. return $this;
  28. }
  29. }