Completed
Push — master ( bb4d5a...e8c3b1 )
by Valentyn
04:47
created

MovieActor::getMovie()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Movies\Entity;
6
7
use App\Actors\Entity\Actor;
8
use Doctrine\ORM\Mapping as ORM;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
11
/**
12
 * @ORM\Entity(repositoryClass="App\Movies\Repository\MovieActorRepository")
13
 * @ORM\Table(name="movies_actors",
14
 *     uniqueConstraints={
15
 *      @ORM\UniqueConstraint(name="Movie_id_Actor_id", columns={"movie_id", "actor_id"})
16
 *     })
17
 */
18
class MovieActor
19
{
20
    /**
21
     * @ORM\Id()
22
     * @ORM\GeneratedValue()
23
     * @ORM\Column(type="integer")
24
     * @Groups({"list", "view"})
25
     */
26
    private $id;
27
28
    /**
29
     * @ORM\ManyToOne(targetEntity="App\Movies\Entity\Movie")
30
     * @ORM\JoinColumn(nullable=false)
31
     * @Groups({"list", "view"})
32
     */
33
    private $movie;
34
35
    /**
36
     * @ORM\ManyToOne(targetEntity="App\Actors\Entity\Actor")
37
     * @ORM\JoinColumn(nullable=false)
38
     * @Groups({"list", "view"})
39
     */
40
    private $actor;
41
42
    public function __construct(Movie $movie, Actor $actor)
43
    {
44
        $this->movie = $movie;
45
        $this->actor = $actor;
46
    }
47
48
    /**
49
     * @return int
50
     */
51 1
    public function getId(): int
52
    {
53 1
        return $this->id;
54
    }
55
56
    /**
57
     * @return Movie
58
     */
59 1
    public function getMovie(): Movie
60
    {
61 1
        return $this->movie;
62
    }
63
64
    /**
65
     * @return Actor
66
     */
67 2
    public function getActor(): Actor
68
    {
69 2
        return $this->actor;
70
    }
71
}
72