Add actors and their roles
This commit is contained in:
65
src/Entity/MovieRole.php
Normal file
65
src/Entity/MovieRole.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MovieRoleRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MovieRoleRepository::class)]
|
||||
class MovieRole
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $character = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'movieRoles')]
|
||||
private ?Actor $actor = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'actors')]
|
||||
private ?Movie $movie = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getCharacter(): ?string
|
||||
{
|
||||
return $this->character;
|
||||
}
|
||||
|
||||
public function setCharacter(string $character): static
|
||||
{
|
||||
$this->character = $character;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getActor(): ?Actor
|
||||
{
|
||||
return $this->actor;
|
||||
}
|
||||
|
||||
public function setActor(?Actor $actor): static
|
||||
{
|
||||
$this->actor = $actor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMovie(): ?Movie
|
||||
{
|
||||
return $this->movie;
|
||||
}
|
||||
|
||||
public function setMovie(?Movie $movie): static
|
||||
{
|
||||
$this->movie = $movie;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user