<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\HttpFoundation\File\File;
/**
* @ORM\Entity()
* @ORM\Table(name="app_question_image")
* @Vich\Uploadable
*/
class QuestionImage
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $imageName = null;
/**
* @Vich\UploadableField(mapping="question_images", fileNameProperty="imageName")
*/
private ?File $imageFile = null;
/**
* @ORM\ManyToOne(targetEntity=Question::class, inversedBy="images")
* @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
*/
private ?Question $question;
/**
* @ORM\Column(type="boolean")
*/
private bool $isKg = false;
/**
* @ORM\Column(type="datetime")
*/
private \DateTimeInterface $updatedAt;
public function getId(): int
{
return $this->id;
}
public function setImageFile(?File $imageFile = null): void
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function setImageName(?string $imageName): void
{
$this->imageName = $imageName;
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function setQuestion(?Question $question): void
{
$this->question = $question;
}
public function getQuestion(): Question
{
return $this->question;
}
public function isKg(): bool
{
return $this->isKg;
}
public function setIsKg(bool $isKg): self
{
$this->isKg = $isKg;
return $this;
}
}