Test Failed
Push — master ( 09495e...5db298 )
by Daniel
04:30
created

ComponentPositionRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components 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\ApiComponentsBundle\Repository\Core;
15
16
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
17
use Doctrine\Persistence\ManagerRegistry;
18
use Silverback\ApiComponentsBundle\Entity\Core\ComponentInterface;
19
use Silverback\ApiComponentsBundle\Entity\Core\ComponentPosition;
20
21
/**
22
 * @author Daniel West <[email protected]>
23
 *
24
 * @method ComponentPosition|null find($id, $lockMode = null, $lockVersion = null)
25
 * @method ComponentPosition|null findOneBy(array $criteria, array $orderBy = null)
26
 * @method ComponentPosition[]    findAll()
27
 * @method ComponentPosition[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
28
 */
29
class ComponentPositionRepository extends ServiceEntityRepository
30
{
31
    public function __construct(ManagerRegistry $registry)
32
    {
33
        parent::__construct($registry, ComponentPosition::class);
34
    }
35
36
    public function findByComponent(ComponentInterface $component): array
37
    {
38
        return $this->findBy([
39
            'component' => $component,
40
        ]);
41
    }
42
}
43