MenuRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A findOneMenuByMachineNameAndLocale() 0 13 1
1
<?php
2
3
namespace Alpixel\Bundle\MenuBundle\Entity\Repository;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class MenuRepository extends EntityRepository
8
{
9
    public function findOneMenuByMachineNameAndLocale($machineName, $locale)
10
    {
11
        return $this->createQueryBuilder('m')
12
            ->leftJoin('m.items', 'i')
13
            ->where('m.machineName = :machineName')
14
            ->andWhere('m.locale = :locale')
15
            ->setParameters([
16
                'machineName' => $machineName,
17
                'locale'      => $locale,
18
            ])
19
            ->getQuery()
20
            ->getSingleResult();
21
    }
22
}
23