| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 16 | 1 | public function getPostWithComments($postId) |
|
| 17 | 1 | { |
|
| 18 | 1 | /** @var QueryBuilder $qb */ |
|
| 19 | 1 | $qb = $this->createQueryBuilder('p'); |
|
| 20 | 1 | return $qb |
|
| 21 | 1 | ->select(['p', 'c', 'a']) |
|
| 22 | ->leftJoin('p.comments', 'c') |
||
| 23 | ->leftJoin('c.author', 'a') |
||
| 24 | ->where($qb->expr()->eq('p.id', ':post_id')) |
||
| 25 | ->orderBy('c.number', 'asc') |
||
| 26 | ->setParameter('post_id', $postId) |
||
| 27 | ->getQuery()->getOneOrNullResult() |
||
| 28 | ; |
||
| 29 | } |
||
| 30 | } |