Skip to content
Snippets Groups Projects
Verified Commit 2c377343 authored by Greg0ire's avatar Greg0ire
Browse files

Focus on the interface

parent 9df2cd0d
No related branches found
No related tags found
1 merge request!9Retours ngrekas
...@@ -349,16 +349,7 @@ final class DoctrineArticleRepository implements ArticleRepository, ServiceEntit ...@@ -349,16 +349,7 @@ final class DoctrineArticleRepository implements ArticleRepository, ServiceEntit
$this->entityManager = $registry->getManagerForClass(Article::class); $this->entityManager = $registry->getManagerForClass(Article::class);
} }
public function latestArticles(int $size): iterable // your methods…
{
$this->entityManager->createQueryBuilder()
->select('a.*')
->from(Article::class)
->orderBy('a.createdAt', 'DESC')
->setMaxResults($size)
->getQuery()
->getResults();
}
} }
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment