Completed
Pull Request — 2.x (#124)
by Christian
02:47
created

TranslatableTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setLocale() 0 4 1
A getLocale() 0 4 1
1
<?php
2
3
namespace Sonata\TranslationBundle\Traits;
4
5
/**
6
 * If you don't want to use trait, you can extend AbstractTranslatable instead.
7
 *
8
 * @author Nicolas Bastien <[email protected]>
9
 */
10
trait TranslatableTrait
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $locale;
16
17
    /**
18
     * @param string $locale
19
     */
20
    public function setLocale($locale)
21
    {
22
        $this->locale = $locale;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getLocale()
29
    {
30
        return $this->locale;
31
    }
32
}
33