Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function findOneByGatewayFactoryNameAndChannel(string $gatewayFactoryName, ChannelInterface $channel): ?PaymentMethodInterface |
||
22 | { |
||
23 | return $this->createQueryBuilder('o') |
||
24 | ->innerJoin('o.gatewayConfig', 'gatewayConfig') |
||
25 | ->where('gatewayConfig.factoryName = :gatewayFactoryName') |
||
26 | ->andWhere(':channel MEMBER OF o.channels') |
||
27 | ->andWhere('o.enabled = true') |
||
28 | ->addOrderBy('o.position') |
||
29 | ->setParameter('gatewayFactoryName', $gatewayFactoryName) |
||
30 | ->setParameter('channel', $channel) |
||
31 | ->setMaxResults(1) |
||
32 | ->getQuery() |
||
33 | ->getOneOrNullResult() |
||
34 | ; |
||
37 |