| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function paginate(AuthorId $authorId = null): Pagerfanta |
||
| 41 | { |
||
| 42 | $qb = $this->createQueryBuilder('b')->orderBy('b.createdAt', 'DESC'); |
||
| 43 | |||
| 44 | if ($authorId) { |
||
| 45 | $qb->where('b.authorId = :author_id')->setParameter('author_id', $authorId); |
||
| 46 | } |
||
| 47 | |||
| 48 | return new Pagerfanta(new DoctrineORMAdapter($qb, true, false)); |
||
| 49 | } |
||
| 51 |