1 | <?php |
||
22 | class Actor implements TranslatableInterface |
||
23 | { |
||
24 | use TranslatableTrait; |
||
25 | |||
26 | const GENDER_MALE = 2; |
||
27 | const GENDER_FEMALE = 1; |
||
28 | |||
29 | /** |
||
30 | * @ORM\Id() |
||
31 | * @ORM\GeneratedValue() |
||
32 | * @ORM\Column(type="integer") |
||
33 | * @Groups({"list", "view"}) |
||
34 | */ |
||
35 | private $id; |
||
36 | |||
37 | /** |
||
38 | * @var ActorTranslations[]|ArrayCollection |
||
39 | * @ORM\OneToMany(targetEntity="App\Actors\Entity\ActorTranslations", mappedBy="actor", cascade={"persist", "remove"}) |
||
40 | * @Assert\Valid(traverse=true) |
||
41 | * @Groups({"list", "view"}) |
||
42 | */ |
||
43 | private $translations; |
||
44 | |||
45 | /** |
||
46 | * @var ActorContacts[]|ArrayCollection |
||
47 | * @ORM\OneToMany(targetEntity="App\Actors\Entity\ActorContacts", mappedBy="actor", cascade={"persist", "remove"}) |
||
48 | * @ORM\JoinColumn(nullable=true) |
||
49 | * @Groups({"view"}) |
||
50 | */ |
||
51 | private $contacts; |
||
52 | |||
53 | /** |
||
54 | * @Groups({"list", "view"}) |
||
55 | * @ORM\Column(type="string", length=100) |
||
56 | */ |
||
57 | private $originalName; |
||
58 | |||
59 | /** |
||
60 | * @Groups({"list", "view"}) |
||
61 | * @ORM\Column(type="string", length=255, nullable=true) |
||
62 | */ |
||
63 | private $photo; |
||
64 | |||
65 | /** |
||
66 | * @ORM\Embedded(class="App\Actors\Entity\ActorTMDB", columnPrefix="tmdb_") |
||
67 | * @Assert\Valid(traverse=true) |
||
68 | * @Groups({"list", "view"}) |
||
69 | */ |
||
70 | private $tmdb; |
||
71 | |||
72 | /** |
||
73 | * @ORM\Column(type="string", length=20, nullable=true) |
||
74 | * @Groups({"view"}) |
||
75 | */ |
||
76 | private $imdbId; |
||
77 | |||
78 | /** |
||
79 | * @Groups({"list", "view"}) |
||
80 | * @ORM\Column(type="date", nullable=true) |
||
81 | */ |
||
82 | private $birthday; |
||
83 | |||
84 | /** |
||
85 | * @Groups({"list", "view"}) |
||
86 | * @ORM\Column(type="integer", length=1, nullable=false) |
||
87 | */ |
||
88 | private $gender; |
||
89 | |||
90 | 2 | public function __construct(string $originalName, ActorTMDB $actorTMDB) |
|
99 | |||
100 | 4 | public function getId(): int |
|
104 | |||
105 | 6 | public function getOriginalName(): string |
|
109 | |||
110 | 2 | public function setOriginalName(string $originalName): void |
|
114 | |||
115 | 6 | public function getPhoto(): ?string |
|
119 | |||
120 | 2 | public function setPhoto(string $photo): void |
|
124 | |||
125 | 6 | public function getTmdb(): ActorTMDB |
|
129 | |||
130 | public function setTmdb(ActorTMDB $tmdb): void |
||
134 | |||
135 | 5 | public function getImdbId(): ?string |
|
139 | |||
140 | 4 | public function setImdbId(string $imdbId): void |
|
144 | |||
145 | 5 | public function getBirthday(): ?\DateTimeInterface |
|
149 | |||
150 | 4 | public function setBirthday(\DateTimeInterface $birthday): void |
|
154 | |||
155 | 6 | public function getGender(): int |
|
159 | |||
160 | /** |
||
161 | * @param int $gender |
||
162 | * |
||
163 | * @throws \InvalidArgumentException |
||
164 | */ |
||
165 | 4 | public function setGender(int $gender): void |
|
172 | |||
173 | 3 | public function getContacts() |
|
177 | } |
||
178 |