ContentRepository::findByReference()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace Axstrad\Bundle\ContentBundle\Entity\Repository;
3
4
use Axstrad\Bundle\ContentBundle\Repository\ContentRepository as ContentRepositoryInterface;
5
use Doctrine\ORM\EntityRepository;
6
use PhpOption\Option as PhpOption;
7
8
/**
9
 * Axstrad\Bundle\ContentBundle\Entity\Repository\ContentRepository
10
 */
11
class ContentRepository extends EntityRepository implements
12
    ContentRepositoryInterface
13
{
14
    /**
15
     * @param string $reference
16
     * @return \Axstrad\Bundle\ContentBundle\Entity\Content
17
     * @uses findOneBy
18
     */
19
    public function findByReference($reference)
20
    {
21
        return PhpOption::fromValue(
22
            $this->findOneBy(array('reference' => $reference))
23
        );
24
    }
25
}
26