You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NewsModel.php 1.9KB

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