<?php
namespace App\Entity\Channel\PositioningTest;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use DrosalysWeb\ObjectExtensions\Blame\Model\BlameInterface;
use DrosalysWeb\ObjectExtensions\Blame\Model\BlameTrait;
use DrosalysWeb\ObjectExtensions\Timestamp\Model\TimestampInterface;
use DrosalysWeb\ObjectExtensions\Timestamp\Model\TimestampTrait;
use Symfony\Component\Validator\Constraints as Assert;
#[
ORM\Entity(),
ORM\Table(name: 'channel_positioning_test_question_answers'),
]
class QuestionAnswer implements TimestampInterface, BlameInterface
{
use TimestampTrait;
use BlameTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'boolean')]
private bool $valid = false;
#[ORM\Column(type: 'string', length: 255)]
#[
Assert\NotBlank(message: 'positioningTest.question.label.NotBlank'),
Assert\Length(
max: 255,
maxMessage: 'positioningTest.question.label.Length.max'
)
]
private ?string $label = null;
#[ORM\Column(type: 'integer')]
private ?int $rank = null;
#[ORM\ManyToOne(targetEntity: Question::class, inversedBy: 'answers')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Question $question = null;
public function getId(): ?int
{
return $this->id;
}
public function isValid(): bool
{
return $this->valid;
}
public function setValid(bool $valid): static
{
$this->valid = $valid;
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(?string $label): static
{
$this->label = $label;
return $this;
}
public function getRank(): ?int
{
return $this->rank;
}
public function setRank(?int $rank): static
{
$this->rank = $rank;
return $this;
}
public function getQuestion(): ?Question
{
return $this->question;
}
public function setQuestion(?Question $question): static
{
$this->question = $question;
return $this;
}
}