Translation   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 125
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 125
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 4 1
A setKey() 0 6 1
A getLanguage() 0 4 1
A setLanguage() 0 6 1
A getTranslation() 0 4 1
A setTranslation() 0 6 1
A getCatalogue() 0 4 1
A setCatalogue() 0 6 1
1
<?php
2
3
namespace Webcook\Cms\I18nBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Webcook\Cms\CoreBundle\Base\BasicEntity;
7
use ApiPlatform\Core\Annotation\ApiResource;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
/**
11
 * Translation entity used for translations of strings.
12
 *
13
 * @ORM\Entity
14
 * @ORM\Table(name="Translation")
15
 * @ApiResource
16
 */
17
class Translation extends BasicEntity
18
{
19
    /** 
20
     * @ORM\Column(name="translation_key", type="string", length=128) 
21
     * @Assert\NotBlank
22
     * @Assert\NotNull
23
     */
24
    private $key;
25
26
    /** 
27
     * @ORM\Column(name="catalogue", type="string", length=128) 
28
     * @Assert\NotNull
29
     * @Assert\NotBlank
30
     */
31
    private $catalogue;
32
33
    /** 
34
     * @ORM\ManyToOne(targetEntity="Language") 
35
     * @Assert\NotNull
36
     */
37
    private $language;
38
39
    /**
40
     * @ORM\Column(name="translation", type="text")
41
     * @Assert\NotBlank
42
     * @Assert\NotNull
43
     */
44
    private $translation;
45
46
    /**
47
     * Gets the value of key.
48
     *
49
     * @return mixed
50
     */
51 4
    public function getKey()
52
    {
53 4
        return $this->key;
54
    }
55
56
    /**
57
     * Sets the value of key.
58
     *
59
     * @param mixed $key the key
60
     *
61
     * @return self
62
     */
63 7
    public function setKey($key)
64
    {
65 7
        $this->key = $key;
66
67 7
        return $this;
68
    }
69
70
    /**
71
     * Gets the value of language.
72
     *
73
     * @return mixed
74
     */
75 4
    public function getLanguage()
76
    {
77 4
        return $this->language;
78
    }
79
80
    /**
81
     * Sets the value of language.
82
     *
83
     * @param mixed $language the language
84
     *
85
     * @return self
86
     */
87 7
    public function setLanguage($language)
88
    {
89 7
        $this->language = $language;
90
91 7
        return $this;
92
    }
93
94
    /**
95
     * Gets the value of translation.
96
     *
97
     * @return mixed
98
     */
99 4
    public function getTranslation()
100
    {
101 4
        return $this->translation;
102
    }
103
104
    /**
105
     * Sets the value of translation.
106
     *
107
     * @param mixed $translation the translation
108
     *
109
     * @return self
110
     */
111 7
    public function setTranslation($translation)
112
    {
113 7
        $this->translation = $translation;
114
115 7
        return $this;
116
    }
117
118
    /**
119
     * Gets the value of catalogue.
120
     *
121
     * @return mixed
122
     */
123 4
    public function getCatalogue()
124
    {
125 4
        return $this->catalogue;
126
    }
127
128
    /**
129
     * Sets the value of catalogue.
130
     *
131
     * @param mixed $catalogue the catalogue
132
     *
133
     * @return self
134
     */
135 7
    public function setCatalogue($catalogue)
136
    {
137 7
        $this->catalogue = $catalogue;
138
139 7
        return $this;
140
    }
141
}
142