ItemRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 17
ccs 0
cts 9
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A findByCatalogItem() 0 9 1
1
<?php
2
/**
3
 * AnimeDb package
4
 *
5
 * @package   AnimeDb
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
9
 */
10
11
namespace AnimeDb\Bundle\MyAnimeListSyncBundle\Repository;
12
13
use Doctrine\ORM\EntityRepository;
14
use AnimeDb\Bundle\MyAnimeListSyncBundle\Entity\Item;
15
use AnimeDb\Bundle\CatalogBundle\Entity\Item as CatalogItem;
16
17
/**
18
 * @package AnimeDb\Bundle\MyAnimeListSyncBundle\Repository
19
 * @author  Peter Gribanov <[email protected]>
20
 */
21
class ItemRepository extends EntityRepository
22
{
23
    /**
24
     * @param CatalogItem $item
25
     *
26
     * @return Item|null
27
     */
28
    public function findByCatalogItem(CatalogItem $item)
29
    {
30
        return $this
31
            ->createQueryBuilder('i')
32
            ->where('i.item_id = :id')
33
            ->setParameter(':id', $item->getId())
34
            ->getQuery()
35
            ->getOneOrNullResult();
36
    }
37
}
38