<?php
namespace App\Entity;
use App\Repository\StatusRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: StatusRepository::class)]
class Status
{
/*
Prospect => Prospect
Need contact => A contacter
Contact refused => Annulation
Contact no response => Abandon
Contacted / Waiting => Contacté / En attente
Application received=> Dossiers reçus
Application refused => Refusé
Jury booked => Passage en jury
Jury accepted => Jury – Accepté
Jury refused => Jury – Refusé
Test validated => QCM Validés
Test failed => QCM refusés
Test not taken => QCM non réalisés
Interview invited => Convocation entretien
Interview done => Oraux effectués
Interview skipped => Pas venu aux oraux
Student eligible => Admis
Student refused => Refusé après oraux
Student enrolled => Accompte payé
Disclaimer => Désistement
*/
const STATUS_PROSPECT = 100;
const STATUS_NEED_CONTACT = 200;
const STATUS_CONTACTED_WAITING = 300;
const STATUS_APPLICATION_RECEIVED = 400;
const STATUS_APPLICATION_REFUSED = 500;
const STATUS_JURY_BOOKED = 600;
const STATUS_JURY_ACCEPTED = 700;
const STATUS_JURY_REFUSED = 800;
const STATUS_TEST_VALIDATED = 900;
const STATUS_TEST_FAILED = 1000;
const STATUS_TEST_NOT_TAKEN = 1100;
const STATUS_INTERVIEW_INVITED = 1200;
const STATUS_INTERVIEW_DONE = 1300;
const STATUS_INTERVIEW_SKIPPED = 1400;
const STATUS_STUDENT_ELIGIBLE = 1500;
const STATUS_STUDENT_REFUSED = 1600;
const STATUS_STUDENT_ENROLLED = 1700;
const STATUS_DISCLAIMER = 1800;
const STATUS_CONTACT_REFUSED = 250;
const STATUS_CONTACT_NO_RESPONSE = 275;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @Gedmo\Translatable
*/
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $sort = null;
#[ORM\OneToMany(targetEntity: Profile::class, mappedBy: 'status')]
private Collection $profiles;
#[ORM\Column(type: 'integer', options: ['default' => 1])]
private ?int $active = null;
public function __construct()
{
$this->profiles = new ArrayCollection();
}
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 getSort(): ?int
{
return $this->sort;
}
public function setSort(?int $sort): self
{
$this->sort = $sort;
return $this;
}
/**
* @return Collection<int, Profile>
*/
public function getProfiles(): Collection
{
return $this->profiles;
}
public function addProfile(Profile $profile): self
{
if (!$this->profiles->contains($profile)) {
$this->profiles[] = $profile;
$profile->setStatus($this);
}
return $this;
}
public function removeProfile(Profile $profile): self
{
if ($this->profiles->removeElement($profile)) {
// set the owning side to null (unless already changed)
if ($profile->getStatus() === $this) {
$profile->setStatus(null);
}
}
return $this;
}
public function getActive(): ?int
{
return $this->active;
}
public function setActive(int $active): self
{
$this->active = $active;
return $this;
}
}