<?php
namespace App\Entity\Gos\Uniqskills;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* UserAnswerFile
*
* @ORM\Table(name="user_answer_file")
* @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\UserAnswerFileRepository")
* @ORM\HasLifecycleCallbacks
*/
class UserAnswerFile
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @Assert\File(
* maxSize="50M",
* mimeTypes={
* "image/png",
* "image/jpeg", "image/pjpeg",
* "application/pdf", "application/x-pdf",
* "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
* "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
* "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation",
* "application/vnd.oasis.opendocument.text",
* "text/rtf",
* "text/html",
* "text/plain"
* }
* )
*
* @var string
*/
private $file;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $downloadAt;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity="UserAnswer", inversedBy="userAnswerFile")
* @ORM\JoinColumn(onDelete="cascade")
*/
private $userAnswer;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->id;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getFile(): ?string
{
return $this->file;
}
public function setFile(?string $file): self
{
$this->file = $file;
return $this;
}
public function getDownloadAt(): ?\DateTimeInterface
{
return $this->downloadAt;
}
public function setDownloadAt(?\DateTimeInterface $downloadAt): self
{
$this->downloadAt = $downloadAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getUserAnswer(): ?UserAnswer
{
return $this->userAnswer;
}
public function setUserAnswer(?UserAnswer $userAnswer): self
{
$this->userAnswer = $userAnswer;
return $this;
}
/* ****************************** GETTERS & SETTERS ****************************** */
}