Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

92 lines
1.8KB

  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. use Lc\SovBundle\Model\File\FileInterface;
  7. use Lc\SovBundle\Model\Newsletter\NewsletterInterface;
  8. /**
  9. * @ORM\MappedSuperclass()
  10. */
  11. abstract class NewsModel extends AbstractFullEntity implements NewsInterface
  12. {
  13. /**
  14. * @ORM\Column(type="datetime")
  15. * @Gedmo\Timestampable(on="create")
  16. */
  17. protected $date;
  18. /**
  19. * @ORM\Column(type="boolean", nullable=true)
  20. */
  21. protected $isSent;
  22. /**
  23. * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Newsletter\NewsletterInsterface", inversedBy="news")
  24. */
  25. protected $newsletter;
  26. /**
  27. * @ORM\ManyToOne(targetEntity="Lc\SovBundle\File\FileInsterface", cascade={"persist", "remove"})
  28. */
  29. protected $image;
  30. public function __toString()
  31. {
  32. return $this->getTitle();
  33. }
  34. public function getDate(): ?\DateTimeInterface
  35. {
  36. return $this->date;
  37. }
  38. public function setDate(\DateTimeInterface $date): self
  39. {
  40. $this->date = $date;
  41. return $this;
  42. }
  43. public function getIsSent(): ?bool
  44. {
  45. return $this->isSent;
  46. }
  47. public function setIsSent(?bool $isSent): self
  48. {
  49. $this->isSent = $isSent;
  50. return $this;
  51. }
  52. public function getImage(): ?FileInterface
  53. {
  54. return $this->image;
  55. }
  56. public function setImage(?FileInterface $image): self
  57. {
  58. $this->image = $image;
  59. return $this;
  60. }
  61. public function getNewsletter(): ?NewsletterInterface
  62. {
  63. return $this->newsletter;
  64. }
  65. public function setNewsletter(?NewsletterInterface $newsletter): self
  66. {
  67. $this->newsletter = $newsletter;
  68. return $this;
  69. }
  70. }