Completed
Push — v2 ( 41359e...4c6274 )
by Daniel
03:47
created

LayoutRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 11
ccs 0
cts 6
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A findDefault() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Component Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentBundle\Repository\Core;
15
16
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
17
use Doctrine\Persistence\ManagerRegistry;
18
use Silverback\ApiComponentBundle\Entity\Core\Layout;
19
20
/**
21
 * @author Daniel West <[email protected]>
22
 *
23
 * @method Layout|null find($id, $lockMode = null, $lockVersion = null)
24
 * @method Layout|null findOneBy(array $criteria, array $orderBy = null)
25
 * @method Layout[]    findAll()
26
 * @method Layout[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
27
 */
28
class LayoutRepository extends ServiceEntityRepository
29
{
30
    public function __construct(ManagerRegistry $registry)
31
    {
32
        parent::__construct($registry, Layout::class);
33
    }
34
35
    public function findDefault()
36
    {
37
        return $this->findOneBy([
38
            'default' => true
39
        ]);
40
    }
41
}
42