feat: add Award entity and repository
This commit is contained in:
84
src/Entity/Award.php
Normal file
84
src/Entity/Award.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\AwardRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: AwardRepository::class)]
|
||||
class Award
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: AwardType::class, inversedBy: 'awards')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private AwardType $awardType;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Actor::class, inversedBy: 'awards')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private Actor $actor;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private string $name;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $year = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getAwardType(): AwardType
|
||||
{
|
||||
return $this->awardType;
|
||||
}
|
||||
|
||||
public function setAwardType(AwardType $awardType): static
|
||||
{
|
||||
$this->awardType = $awardType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getActor(): Actor
|
||||
{
|
||||
return $this->actor;
|
||||
}
|
||||
|
||||
public function setActor(Actor $actor): static
|
||||
{
|
||||
$this->actor = $actor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getYear(): ?int
|
||||
{
|
||||
return $this->year;
|
||||
}
|
||||
|
||||
public function setYear(?int $year): static
|
||||
{
|
||||
$this->year = $year;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user