Sfoglia il codice sorgente

Frontend : actualités (list, view)

reduction
Guillaume 4 anni fa
parent
commit
f8b68ae78c
1 ha cambiato i file con 9 aggiunte e 6 eliminazioni
  1. +9
    -6
      ShopBundle/Repository/NewsRepository.php

+ 9
- 6
ShopBundle/Repository/NewsRepository.php Vedi File

@@ -19,12 +19,15 @@ class NewsRepository extends BaseRepository implements DefaultRepositoryInterfac
return NewsInterface::class;
}

public function findLastNewsHome()
public function findLatests($maxResults = 0)
{
return $this->findByMerchantQuery()
->orderBy('e.date', 'DESC')
->setMaxResults(2)
->getQuery()
->getResult();
$result = $this->findByMerchantQuery()
->orderBy('e.date', 'DESC') ;

if($maxResults) {
$result->setMaxResults($maxResults) ;
}

return $result->getQuery()->getResult() ;
}
}

Loading…
Annulla
Salva