<?php
namespace App\Entity;
use App\Repository\AdmissionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: AdmissionRepository::class)]
class Admission
{
public const STATE_PENDING = 'pending';
public const STATE_REGISTER = 'register';
public const STATE_CONFIRM = 'confirm';
public const STATE_FINISHED = 'finished';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Groups(['list'])]
private ?int $id;
#[ORM\ManyToOne(targetEntity: Degree::class)]
#[Groups(['list'])]
private ?Degree $degree;
#[ORM\Column(type: 'string', length: 30, unique: true)]
#[Groups(['list'])]
private ?string $code;
#[ORM\Column(type: 'string', length: 100)]
#[Groups(['list'])]
private ?string $name;
#[ORM\Column(type: 'date')]
#[Groups(['list'])]
private ?\DateTimeInterface $registerStart;
#[ORM\Column(type: 'date')]
#[Groups(['list'])]
private ?\DateTimeInterface $registerEnd;
#[ORM\Column(type: 'integer')]
#[Groups(['list'])]
private ?int $registerFeeAmount;
#[ORM\Column(type: 'integer')]
#[Groups(['list'])]
private ?int $creditFeeAmount;
#[ORM\Column(type: 'integer')]
#[Groups(['list'])]
private ?int $registerStudentDiscount;
#[ORM\Column(type: 'datetime')]
#[Groups(['list'])]
private ?\DateTimeInterface $confirmStart;
#[ORM\Column(type: 'datetime')]
#[Groups(['list'])]
private ?\DateTimeInterface $confirmEnd;
#[ORM\Column(type: 'boolean')]
#[Groups(['list'])]
private ?bool $satExam;
#[ORM\Column(type: 'boolean')]
#[Groups(['list'])]
private ?bool $registrationFee;
#[ORM\Column(type: 'string', length: 20)]
#[Groups(['list'])]
private ?string $state;
#[ORM\OneToMany(mappedBy: 'admission', targetEntity: AdmissionConfig::class)]
#[Groups(['list','detail'])]
private $configs;
#[ORM\Column(type: 'string', length: 100)]
#[Groups(['list'])]
private ?string $studyYear;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['list'])]
private ?string $studySession;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['list'])]
private ?string $studyLanguage;
#[ORM\Column(type: 'boolean')]
private ?bool $isDeleted;
#[ORM\ManyToOne(targetEntity: File::class)]
private $file;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['list'])]
private $filePath;
#[ORM\ManyToOne(targetEntity: File::class)]
private $image;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['list'])]
private $imagePath;
#[ORM\Column(type: 'string', length: 100, nullable: true)]
#[Groups(['list'])]
private ?string $location;
public function __toString(): string {
return $this->name;
}
public function __construct()
{
$this->configs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDegree(): ?Degree
{
return $this->degree;
}
public function setDegree(?Degree $degree): self
{
$this->degree = $degree;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function getLocation(): ?string
{
return $this->location;
}
public function getFile(): ?File
{
return $this->file;
}
public function setFile(?File $file): self
{
$this->file = $file;
return $this;
}
public function getFilePath(): ?string
{
return $this->filePath;
}
public function setFilePath(string $filePath): self
{
$this->filePath = $filePath;
return $this;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function setLocation(string $location): self
{
$this->location = $location;
return $this;
}
public function getRegisterStart(): ?\DateTimeInterface
{
return $this->registerStart;
}
public function setRegisterStart(\DateTimeInterface $registerStart): self
{
$this->registerStart = $registerStart;
return $this;
}
public function getRegisterEnd(): ?\DateTimeInterface
{
return $this->registerEnd;
}
public function setRegisterEnd(\DateTimeInterface $registerEnd): self
{
$this->registerEnd = $registerEnd;
return $this;
}
public function getConfirmStart(): ?\DateTimeInterface
{
return $this->confirmStart;
}
public function setConfirmStart(\DateTimeInterface $confirmStart): self
{
$this->confirmStart = $confirmStart;
return $this;
}
public function getConfirmEnd(): ?\DateTimeInterface
{
return $this->confirmEnd;
}
public function setConfirmEnd(\DateTimeInterface $confirmEnd): self
{
$this->confirmEnd = $confirmEnd;
return $this;
}
public function getSatExam(): ?bool
{
return $this->satExam;
}
public function setSatExam(bool $satExam): self
{
$this->satExam = $satExam;
return $this;
}
public function getRegistrationFee(): ?bool
{
return $this->registrationFee;
}
public function setRegistrationFee(bool $registrationFee): self
{
$this->registrationFee = $registrationFee;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(string $state): self
{
$this->state = $state;
return $this;
}
public function getRegisterFeeAmount(): ?int
{
return $this->registerFeeAmount;
}
public function setRegisterFeeAmount(int $registerFeeAmount): self
{
$this->registerFeeAmount = $registerFeeAmount;
return $this;
}
public function getRegisterStudentDiscount(): ?int
{
return $this->registerStudentDiscount;
}
public function setRegisterStudentDiscount(int $registerStudentDiscount): self
{
$this->registerStudentDiscount = $registerStudentDiscount;
return $this;
}
public function getCreditFeeAmount(): ?int
{
return $this->creditFeeAmount;
}
public function setCreditFeeAmount(int $creditFeeAmount): self
{
$this->creditFeeAmount = $creditFeeAmount;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
/**
* @return Collection<int, AdmissionConfig>
*/
public function getConfigs(): Collection
{
return $this->configs;
}
public function addConfig(AdmissionConfig $config): self
{
if (!$this->configs->contains($config)) {
$this->configs[] = $config;
$config->setAdmission($this);
}
return $this;
}
public function removeConfig(AdmissionConfig $config): self
{
if ($this->configs->removeElement($config)) {
// set the owning side to null (unless already changed)
if ($config->getAdmission() === $this) {
$config->setAdmission(null);
}
}
return $this;
}
public function isSatExam(): ?bool
{
return $this->satExam;
}
public function getStudyYear(): ?string
{
return $this->studyYear;
}
public function setStudyYear(string $studyYear): self
{
$this->studyYear = $studyYear;
return $this;
}
public function getStudySession(): ?string
{
return $this->studySession;
}
public function setStudySession(string $studySession): self
{
$this->studySession = $studySession;
return $this;
}
public function getStudyLanguage(): ?string
{
return $this->studyLanguage;
}
public function setStudyLanguage(string $studyLanguage): self
{
$this->studyLanguage = $studyLanguage;
return $this;
}
public function isIsDeleted(): ?bool
{
return $this->isDeleted;
}
public function setIsDeleted(bool $isDeleted): self
{
$this->isDeleted = $isDeleted;
return $this;
}
public function getImagePath(): ?string
{
return $this->imagePath;
}
public function setImagePath(?string $imagePath): self
{
$this->imagePath = $imagePath;
return $this;
}
public function getImage(): ?File
{
return $this->image;
}
public function setImage(?File $image): self
{
$this->image = $image;
return $this;
}
public function isRegistrationFee(): ?bool
{
return $this->registrationFee;
}
}