| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 16 | 1 | public function findLastOpenOrder(Customer $param) |
|
| 17 | { |
||
| 18 | 1 | return $this->createQueryBuilder('o') |
|
| 19 | 1 | ->join('o.customer', 'c') |
|
| 20 | 1 | ->where('o.status = :opened') |
|
| 21 | 1 | ->andWhere('c.id = :param') |
|
| 22 | 1 | ->setParameter(':param', $param->getId()) |
|
| 23 | 1 | ->setParameter(':opened', CustomerOrder::STATUS_OPENED) |
|
| 24 | 1 | ->orderBy('o.id', 'DESC') |
|
| 25 | 1 | ->setMaxResults(1) |
|
| 26 | 1 | ->getQuery() |
|
| 27 | 1 | ->getOneOrNullResult() |
|
| 28 | ; |
||
| 29 | } |
||
| 30 | } |
||
| 31 |