Completed
Push — master ( f33fb0...dd4c03 )
by
unknown
02:17
created

TranslatableTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setLocale() 0 4 1
A getLocale() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\TranslationBundle\Traits\Gedmo;
13
14
/**
15
 * If you don't want to use trait, you can extend AbstractTranslatable instead.
16
 *
17
 * @author Nicolas Bastien <[email protected]>
18
 */
19
trait TranslatableTrait
20
{
21
    /**
22
     * @Gedmo\Locale
23
     * Used locale to override Translation listener`s locale
24
     * this is not a mapped field of entity metadata, just a simple property
25
     *
26
     * @var string
27
     */
28
    protected $locale;
29
30
    /**
31
     * @param string $locale
32
     */
33
    public function setLocale($locale)
34
    {
35
        $this->locale = $locale;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getLocale()
42
    {
43
        return $this->locale;
44
    }
45
}
46