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.

26 lines
559B

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Site;
  3. use Lc\CaracoleBundle\Repository\SectionStoreTrait;
  4. use Lc\SovBundle\Repository\Site\NewsStore as SovNewsStore;
  5. class NewsStore extends SovNewsStore
  6. {
  7. use SectionStoreTrait;
  8. public function getLatests(int $maxResults = 0, $query = null): array
  9. {
  10. if (is_null($query)) {
  11. $query = $this->query->create();
  12. }
  13. if ($this->section) {
  14. $query->filterBySection($this->section);
  15. }
  16. return parent::getLatests($maxResults, $query);
  17. }
  18. }