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