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

Article   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTranslationEntityClass() 0 4 1
A __construct() 0 4 1
A getId() 0 4 1
1
<?php
2
3
namespace Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM\Knplabs;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Sonata\TranslationBundle\Tests\Fixtures\Model\Knplabs\TranslatableEntity;
8
9
/**
10
 * @ORM\Table(name="article")
11
 * @ORM\Entity
12
 */
13
final class Article extends TranslatableEntity
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\GeneratedValue
18
     * @ORM\Column(type="integer")
19
     */
20
    private $id;
21
22
    /**
23
     * @var ArrayCollection
24
     *
25
     * @ORM\OneToMany(
26
     *     indexBy="locale",
27
     *     targetEntity="Sonata\TranslationBundle\Tests\Fixtures\Traits\ORM\Knplabs\ArticleTranslation",
28
     *     mappedBy="translatable",
29
     *     orphanRemoval=true,
30
     *     cascade={"persist", "merge", "remove"}
31
     * )
32
     */
33
    protected $translations;
34
35
    public static function getTranslationEntityClass(): string
36
    {
37
        return ArticleTranslation::class;
38
    }
39
40
    public function __construct()
41
    {
42
        $this->translations = new ArrayCollection();
43
    }
44
45
    public function getId()
46
    {
47
        return $this->id;
48
    }
49
}
50