src/Entity/Olympiad/Online/Participant/File.php line 14
<?php
namespace App\Entity\Olympiad\Online\Participant;
use App\Entity\Common\File as UploadedFile;
use App\Entity\Olympiad\Online\Participant;
use App\Entity\Traits\CreatedTrait;
use App\Entity\Traits\UpdatedTrait;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'olymp_online_participant_file')]
#[ORM\Entity(repositoryClass: 'App\Repository\Olympiad\Online\Participant\FileRepository')]
#[ORM\HasLifecycleCallbacks]
class File
{
use CreatedTrait;
use UpdatedTrait;
public const TYPE_WORK_SCAN = 'work_scan';
public const TYPE_PROTOCOL = 'protocol';
public const TYPE_APPEAL = 'appeal';
public const TYPE_APPEAL_NOTIFY = 'appeal_notify';
public const TYPE_PASSPORT = 'passport';
/**
* @var int
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private int $id;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Olympiad\Online\Participant')]
private Participant $participant;
#[ORM\Column(type: 'string')]
private string $type;
/**
* @var UploadedFile
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Common\File')]
#[ORM\JoinColumn(nullable: false)]
private UploadedFile $file;
public static function getParticipantTypes(): array
{
return [self::TYPE_WORK_SCAN, self::TYPE_APPEAL, self::TYPE_APPEAL_NOTIFY, self::TYPE_PROTOCOL];
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id): void
{
$this->id = $id;
}
/**
* @return Participant
*/
public function getParticipant(): Participant
{
return $this->participant;
}
/**
* @param Participant $participant
*/
public function setParticipant(Participant $participant): void
{
$this->participant = $participant;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type): void
{
$this->type = $type;
}
/**
* @return UploadedFile
*/
public function getFile(): UploadedFile
{
return $this->file;
}
/**
* @param UploadedFile $file
*/
public function setFile(UploadedFile $file): void
{
$this->file = $file;
$this->file->setPublic(false);
}
}