GatewayRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A findActive() 0 13 1
1
<?php
2
3
/**
4
 * @author Rafał Muszyński <[email protected]>
5
 * @copyright 2015 Sourcefabric z.ú.
6
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
7
 */
8
9
namespace Newscoop\PaywallBundle\Entity\Repository;
10
11
use Doctrine\ORM\EntityRepository;
12
use Newscoop\PaywallBundle\Adapter\AdapterFactory;
13
14
/**
15
 * Gateway repository.
16
 */
17
class GatewayRepository extends EntityRepository
18
{
19
    /**
20
     * Finds active gateways/pament methods.
21
     */
22
    public function findActive()
23
    {
24
        $qb = $this
25
            ->createQueryBuilder('d')
26
            ->where('d.isActive = true')
27
            ->orWhere('d.name = :default')
28
            ->setParameter('default', AdapterFactory::OFFLINE)
29
        ;
30
31
        return $qb
32
            ->getQuery()
33
        ;
34
    }
35
}
36