1 | <?php |
||
12 | class WatchedMovie |
||
13 | { |
||
14 | /** |
||
15 | * @ORM\ManyToOne(targetEntity="App\Movies\Entity\Movie") |
||
16 | * @ORM\JoinColumn(nullable=false) |
||
17 | */ |
||
18 | protected $movie; |
||
19 | |||
20 | /** |
||
21 | * @Groups({"list", "view"}) |
||
22 | * @ORM\Column(type="decimal", nullable=true) |
||
23 | */ |
||
24 | protected $vote; |
||
25 | |||
26 | /** |
||
27 | * @Groups({"list", "view"}) |
||
28 | * @ORM\Column(type="datetime", nullable=false) |
||
29 | */ |
||
30 | protected $addedAt; |
||
31 | |||
32 | /** |
||
33 | * @Groups({"list", "view"}) |
||
34 | * @ORM\Column(type="date", nullable=true) |
||
35 | */ |
||
36 | protected $watchedAt; |
||
37 | |||
38 | /** |
||
39 | * WatchedMovie constructor. |
||
40 | * |
||
41 | * @param Movie $movie |
||
42 | * @param float|null $vote |
||
43 | * @param \DateTimeInterface|null $watchedAt |
||
44 | * |
||
45 | * @throws \Exception |
||
46 | */ |
||
47 | 10 | public function __construct(Movie $movie, ?float $vote, ?\DateTimeInterface $watchedAt) |
|
54 | |||
55 | public function updateMovie(Movie $movie) |
||
59 | |||
60 | 10 | public function changeVote(?float $vote) |
|
72 | |||
73 | 2 | public function changeWatchedAt(?\DateTimeInterface $watchedAt) |
|
77 | |||
78 | 10 | public function getMovie(): ?Movie |
|
82 | |||
83 | 1 | public function getVote(): ?float |
|
87 | |||
88 | public function getAddedAt(): ?\DateTimeInterface |
||
89 | { |
||
90 | return $this->addedAt; |
||
91 | } |
||
92 | |||
93 | 1 | public function getWatchedAt(): ?\DateTimeInterface |
|
97 | } |
||
98 |