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

CMSHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A nodeGetTranslation() 0 8 1
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