Completed
Push — master ( 59ed7d...9fb967 )
by Valentyn
02:51
created

ActorTranslations::getBiography()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Actors\Entity;
6
7
use App\Translation\EntityTranslationInterface;
8
use App\Translation\TranslatableTrait;
9
use Doctrine\ORM\Mapping as ORM;
10
use Symfony\Component\Serializer\Annotation\Groups;
11
12
/**
13
 * @ORM\Entity
14
 * @ORM\Table(name="actors_translations",
15
 *     uniqueConstraints={
16
 *      @ORM\UniqueConstraint(name="idx_ActorTranslations_locale_actor_id", columns={"locale", "actor_id"})
17
 *     })
18
 */
19
class ActorTranslations implements EntityTranslationInterface
20
{
21
    use TranslatableTrait;
22
23
    /**
24
     * @ORM\Id()
25
     * @ORM\GeneratedValue()
26
     * @ORM\Column(type="integer")
27
     */
28
    private $id;
29
30
    /**
31
     * @Groups({"list", "view"})
32
     * @ORM\Column(type="string", length=5)
33
     */
34
    private $locale;
35
36
    /**
37
     * @ORM\ManyToOne(targetEntity="App\Actors\Entity\Actor", inversedBy="translations")
38
     * @ORM\JoinColumn(nullable=false)
39
     */
40
    private $actor;
41
42
    /**
43
     * @Groups({"list", "view"})
44
     * @ORM\Column(type="string", length=100, nullable=false)
45
     */
46
    private $name;
47
48
    /**
49
     * @Groups({"list", "view"})
50
     * @ORM\Column(type="string", length=100, nullable=true)
51
     */
52
    private $placeOfBirth;
53
54
    /**
55
     * @Groups({"list", "view"})
56
     * @ORM\Column(type="text", nullable=true)
57
     */
58
    private $biography;
59
60
    public function getLocale(): string
61
    {
62
        return $this->locale;
63
    }
64
65
    public function __construct(Actor $actor, string $locale, string $name)
66
    {
67
        $this->actor = $actor;
68
        $this->locale = $locale;
69
        $this->name = $name;
70
    }
71
72
    public function getId()
73
    {
74
        return $this->id;
75
    }
76
77
    public function getName()
78
    {
79
        return $this->name;
80
    }
81
82
    public function setName(string $name): void
83
    {
84
        $this->name = $name;
85
    }
86
87
    public function getPlaceOfBirth()
88
    {
89
        return $this->placeOfBirth;
90
    }
91
92
    public function setPlaceOfBirth(string $placeOfBirth): void
93
    {
94
        $this->placeOfBirth = $placeOfBirth;
95
    }
96
97
    public function getBiography()
98
    {
99
        return $this->biography;
100
    }
101
102
    public function setBiography(string $biography): void
103
    {
104
        $this->biography = $biography;
105
    }
106
}
107