ArticlePersonalTranslatable   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 48
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A setTitle() 0 4 1
A getTitle() 0 4 1
1
<?php
2
3
namespace Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
use Sonata\TranslationBundle\Traits\Gedmo\PersonalTranslatableTrait;
9
10
/**
11
 * @Gedmo\TranslationEntity(class="Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM\ArticlePersonalTranslation")
12
 * @ORM\Table(name="article")
13
 * @ORM\Entity
14
 */
15
class ArticlePersonalTranslatable
16
{
17
    use PersonalTranslatableTrait;
18
19
    /**
20
     * @ORM\Id
21
     * @ORM\GeneratedValue
22
     * @ORM\Column(type="integer")
23
     */
24
    private $id;
25
26
    /**
27
     * @Gedmo\Translatable
28
     * @ORM\Column(length=128)
29
     */
30
    private $title;
31
32
    /**
33
     * @var ArrayCollection
34
     *
35
     * @ORM\OneToMany(
36
     *     targetEntity="Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM\ArticlePersonalTranslation",
37
     *     mappedBy="object",
38
     *     cascade={"persist", "remove"}
39
     * )
40
     */
41
    protected $translations;
42
43
    public function __construct()
44
    {
45
        $this->translations = new ArrayCollection();
46
    }
47
48
    public function getId()
49
    {
50
        return $this->id;
51
    }
52
53
    public function setTitle($title): void
54
    {
55
        $this->title = $title;
56
    }
57
58
    public function getTitle()
59
    {
60
        return $this->title;
61
    }
62
}
63