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

MovieActor   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 52
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A getMovie() 0 4 1
A getActor() 0 4 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
     */
32
    private $movie;
33
34
    /**
35
     * @ORM\ManyToOne(targetEntity="App\Actors\Entity\Actor")
36
     * @ORM\JoinColumn(nullable=false)
37
     */
38
    private $actor;
39
40
    public function __construct(Movie $movie, Actor $actor)
41
    {
42
        $this->movie = $movie;
43
        $this->actor = $actor;
44
    }
45
46
    /**
47
     * @return int
48
     */
49
    public function getId(): int
50
    {
51
        return $this->id;
52
    }
53
54
    /**
55
     * @return Movie
56
     */
57
    public function getMovie(): Movie
58
    {
59
        return $this->movie;
60
    }
61
62
    /**
63
     * @return Actor
64
     */
65
    public function getActor(): Actor
66
    {
67
        return $this->actor;
68
    }
69
}
70