DoctrinePaymentRepository::findByTxId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
/**
4
 * @author    Markus Tacker <[email protected]>
5
 * @copyright 2013-2016 Verein zur Förderung der Netzkultur im Rhein-Main-Gebiet e.V. | http://netzkultur-rheinmain.de/
6
 */
7
8
namespace BCRM\BackendBundle\Entity;
9
10
use Doctrine\ORM\EntityRepository;
11
use PhpOption\Option;
12
13
class DoctrinePaymentRepository extends EntityRepository implements PaymentRepository
14
{
15
    /**
16
     * @return Payment[]
17
     */
18
    public function getUnchecked()
19
    {
20
        $qb = $this->createQueryBuilder('p');
21
        $qb->andWhere('p.checked IS NULL');
22
        return $qb->getQuery()->getResult();
23
    }
24
25
    /**
26
     * @return Option of Payment
27
     */
28
    public function findByTxId($txId)
29
    {
30
        return Option::fromValue($this->createQueryBuilder('p')
31
            ->andWhere('p.txId = :txId')->setParameter('txId', $txId)
32
            ->getQuery()
33
            ->getOneOrNullResult());
34
    }
35
36
}
37