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="profile", 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 | public function __construct(string $originalName, ActorTMDB $actorTMDB) |
||
98 | |||
99 | public function getId(): int |
||
103 | |||
104 | public function getOriginalName(): string |
||
108 | |||
109 | public function setOriginalName(string $originalName): void |
||
113 | |||
114 | public function getPhoto(): string |
||
118 | |||
119 | public function setPhoto(string $photo): void |
||
123 | |||
124 | public function getTmdb(): ActorTMDB |
||
128 | |||
129 | public function setTmdb(ActorTMDB $tmdb): void |
||
133 | |||
134 | public function getImdbId(): string |
||
138 | |||
139 | public function setImdbId(string $imdbId): void |
||
143 | |||
144 | public function getBirthday() |
||
148 | |||
149 | public function setBirthday(\DateTimeInterface $birthday): void |
||
153 | |||
154 | public function getGender() |
||
158 | |||
159 | /** |
||
160 | * @param int $gender |
||
161 | * @throws \InvalidArgumentException |
||
162 | */ |
||
163 | public function setGender(int $gender): void |
||
170 | } |
||
171 |