Files
myep-team/src/Entity/FeedbackSet.php
T

59 lines
1.3 KiB
PHP

<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\FeedbackSetRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: FeedbackSetRepository::class)]
class FeedbackSet implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung ein')]
private ?string $name = null;
#[ORM\Column]
#[Assert\Count(min: 1, minMessage: 'Bitte füge mindestens eine Bewertung hinzu')]
private array $ratings = [];
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getRatings(): array
{
return $this->ratings;
}
public function setRatings(array $ratings): static
{
$this->ratings = $ratings;
return $this;
}
}