|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
-
- namespace Lc\SovBundle\Model\Site;
-
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Lc\SovBundle\Doctrine\Extension\OpenGraphInterface;
- use Lc\SovBundle\Doctrine\Extension\OpenGraphTrait;
- use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
- use Lc\SovBundle\Model\File\FileInterface;
- use Lc\SovBundle\Model\Newsletter\NewsletterInterface;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class NewsModel extends AbstractFullEntity implements NewsInterface, OpenGraphInterface
- {
- use OpenGraphTrait;
-
- /**
- * @ORM\Column(type="datetime")
- * @Gedmo\Timestampable(on="create")
- */
- protected $date;
-
- /**
- * @ORM\Column(type="boolean", nullable=true)
- */
- protected $isSent;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\Newsletter\NewsletterInterface")
- */
- protected $newsletter;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
- */
- protected $image;
-
- public function __toString()
- {
- return $this->getTitle();
- }
-
- public function getDate(): ?\DateTimeInterface
- {
- return $this->date;
- }
-
- public function setDate(\DateTimeInterface $date): self
- {
- $this->date = $date;
-
- return $this;
- }
-
- public function getIsSent(): ?bool
- {
- return $this->isSent;
- }
-
- public function setIsSent(?bool $isSent): self
- {
- $this->isSent = $isSent;
-
- return $this;
- }
-
- public function getImage(): ?FileInterface
- {
- return $this->image;
- }
-
- public function setImage(?FileInterface $image): self
- {
- $this->image = $image;
-
- return $this;
- }
-
- public function getNewsletter(): ?NewsletterInterface
- {
- return $this->newsletter;
- }
-
- public function setNewsletter(?NewsletterInterface $newsletter): self
- {
- $this->newsletter = $newsletter;
-
- return $this;
- }
- }
|