Completed
Push — master ( 6e6249...28ec7c )
by Benjamin
23:40 queued 02:04
created

CMSHelper::nodeGetTranslation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
namespace Alpixel\Bundle\CMSBundle\Helper;
4
5
use Alpixel\Bundle\CMSBundle\Entity\NodeInterface;
6
use Doctrine\ORM\EntityManager;
7
8
class CMSHelper
9
{
10
    protected $entityManager;
11
12
    public function __construct(EntityManager $entityManager)
13
    {
14
        $this->entityManager = $entityManager;
15
    }
16
17
    public function nodeGetTranslation(NodeInterface $node, $locale)
18
    {
19
        $node = $this->entityManager
20
                     ->getRepository('CMSBundle:Node')
21
                     ->findTranslation($node, $locale);
22
23
        return $node;
24
    }
25
}
26