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

NewsletterModel.php 929B

3 年前
3 年前
123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Lc\CaracoleBundle\Model\Newsletter;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
  5. use Lc\CaracoleBundle\Model\Section\SectionInterface;
  6. use Lc\SovBundle\Model\Newsletter\NewsletterModel as SovNewsletterModel;
  7. /**
  8. * @ORM\MappedSuperclass()
  9. */
  10. abstract class NewsletterModel extends SovNewsletterModel implements FilterSectionInterface
  11. {
  12. /**
  13. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="newsletters")
  14. */
  15. protected $section;
  16. public function __toString()
  17. {
  18. return $this->getTitle(). ' - '.$this->getSection()->getMerchant()->getTitle();
  19. }
  20. public function getSection(): SectionInterface
  21. {
  22. return $this->section;
  23. }
  24. public function setSection(?SectionInterface $section): self
  25. {
  26. $this->section = $section;
  27. return $this;
  28. }
  29. }