| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function findOneByCustomerAndProductNotExpired( |
||
| 28 | CustomerInterface $customer, |
||
| 29 | ProductInterface $product |
||
| 30 | ): ?AffiliateInterface { |
||
| 31 | return $this->createQueryBuilder('o') |
||
| 32 | ->andWhere('o.customer = :customer') |
||
| 33 | ->andWhere('o.product = :product') |
||
| 34 | ->andWhere('o.expiresAt > :now') |
||
| 35 | ->setParameter('product', $product) |
||
| 36 | ->setParameter('customer', $customer) |
||
| 37 | ->setParameter('now', new \DateTime()) |
||
| 38 | ->setMaxResults(1) |
||
| 39 | ->getQuery() |
||
| 40 | ->getOneOrNullResult() |
||
| 41 | ; |
||
| 44 |