Completed
Push — master ( 80b11c...96296f )
by
unknown
01:31 queued 10s
created

ArticleTranslation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 43
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 4 1
A setTitle() 0 4 1
A getTranslatableEntityClass() 0 4 1
1
<?php
2
3
namespace Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM\Knplabs;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model\Translatable\Translation;
7
8
/**
9
 * @ORM\Table(name="article_translation")
10
 * @ORM\Entity
11
 */
12
final class ArticleTranslation
13
{
14
    use Translation;
15
16
    /**
17
     * @ORM\Id
18
     * @ORM\GeneratedValue
19
     * @ORM\Column(type="integer")
20
     */
21
    protected $id;
22
23
    /**
24
     * @var Article
25
     *
26
     * @ORM\ManyToOne(
27
     *     targetEntity="Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM\Knplabs\ArticleTranslation",
28
     *     inversedBy="translations",
29
     *     cascade={"persist", "merge"}
30
     * )
31
     * @ORM\JoinColumn(name="translatable_id", referencedColumnName="id", onDelete="CASCADE")
32
     */
33
    protected $translatable;
34
35
    /**
36
     * @ORM\Column(length=128)
37
     */
38
    protected $title;
39
40
    public function getTitle()
41
    {
42
        return $this->title;
43
    }
44
45
    public function setTitle($title)
46
    {
47
        $this->title = $title;
48
    }
49
50
    public static function getTranslatableEntityClass(): string
51
    {
52
        return Article::class;
53
    }
54
}
55