src/Entity/Olympiad/Online/Attendant/Attendant.php line 21
<?php
namespace App\Entity\Olympiad\Online\Attendant;
use App\Entity\Common\Country;
use App\Entity\Common\Passport;
use App\Entity\Geo\Region;
use App\Entity\Olympiad\Online\Event;
use App\Entity\Traits\CreatedTrait;
use App\Entity\Traits\UpdatedTrait;
use App\Entity\User\User;
use App\Model\Olympiad\Online\AppliableInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Table(name: 'olymp_online_attendant')]
#[ORM\Entity(repositoryClass: 'App\Repository\Olympiad\Online\AttendantRepository')]
#[ORM\HasLifecycleCallbacks]
class Attendant implements AppliableInterface
{
use CreatedTrait;
use UpdatedTrait;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User\User')]
private ?User $user = null;
#[ORM\Column(type: 'boolean', options: ['default' => false])]
private bool $canceled = false;
#[ORM\Column(type: 'string', length: 36)]
private string $uuid;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'boolean')]
#[Assert\IsTrue(message: 'participant.unconfirmed', groups: ['full_apply'])]
private bool $confirmed = false;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Olympiad\Online\Event')]
#[ORM\JoinColumn(nullable: false)]
private Event $event;
/**
* @var string
*/
#[ORM\Column(type: 'string')]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private string $firstName;
/**
* @var string|null
*
*/
#[ORM\Column(type: 'string', nullable: true)]
private ?string $middleName = null;
/**
* @var string
*/
#[ORM\Column(type: 'string')]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private string $lastName;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Assert\NotBlank(groups: ['russian_apply', 'russian_passport'])]
private ?string $phone = null;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
#[Assert\Email(groups: ['full_apply', 'Default'])]
private ?string $email = null;
/**
* @var Country|null
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Common\Country')]
#[ORM\JoinColumn(nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private ?Country $country = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Geo\Region')]
#[Assert\NotBlank(groups: ['russian_apply', 'russian_passport'])]
private ?Region $region;
#[ORM\Embedded(class: 'App\Entity\Common\Passport', columnPrefix: 'p_')]
#[Assert\Valid(groups: ['russian_passport', 'russian_apply', 'full_apply', 'Default', 'russian_attendant', 'foreign_attendant'])]
#[Assert\NotBlank(groups: ['Default'], message: 'passport.fill')]
private Passport $passport;
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private ?string $education;
/**
* @var string|null
*/
#[ORM\Column(type: 'text', nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private ?string $addressRegistration = null;
/**
* @var string|null
*/
#[ORM\Column(type: 'text', nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private ?string $addressFact = null;
/**
* @var bool
*/
#[ORM\Column(type: 'boolean', nullable: false, name: 'is_test_data', options: ['default' => 0])]
private bool $test_data = false;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private ?string $workPlace = null;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
private ?string $workPosition = null;
/**
* @var Collection
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\Olympiad\Online\Attendant\AttendantParticipant', mappedBy: 'attendant')]
private Collection $participants;
/**
* @var ?\DateTime
*/
#[ORM\Column(type: 'date', nullable: true)]
#[Assert\NotBlank(groups: ['full_apply', 'Default'])]
#[Assert\GreaterThan('-110 years', groups: ['Default', 'full_apply'])]
#[Assert\LessThan('-10 years', groups: ['Default', 'full_apply'])]
private ?\Datetime $birthday = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $allergy = '';
public function __construct()
{
$this->participants = new ArrayCollection();
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return bool
*/
public function isConfirmed(): bool
{
return $this->confirmed;
}
/**
* @param bool $confirmed
*/
public function setConfirmed(bool $confirmed): void
{
$this->confirmed = $confirmed;
}
/**
* @return string
*/
public function getFirstName(): string
{
return $this->firstName;
}
/**
* @param string $firstName
*/
public function setFirstName(string $firstName): void
{
$this->firstName = $firstName;
}
/**
* @return string|null
*/
public function getMiddleName(): ?string
{
return $this->middleName;
}
/**
* @param string|null $middleName
*/
public function setMiddleName(?string $middleName): void
{
$this->middleName = $middleName;
}
/**
* @return string
*/
public function getLastName(): string
{
return $this->lastName;
}
/**
* @param string $lastName
*/
public function setLastName(string $lastName): void
{
$this->lastName = $lastName;
}
/**
* @return string|null
*/
public function getPhone(): ?string
{
return $this->phone;
}
/**
* @param string|null $phone
*/
public function setPhone(?string $phone): void
{
$this->phone = $phone;
}
/**
* @return string|null
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* @param string|null $email
*/
public function setEmail(?string $email): void
{
$this->email = $email;
}
/**
* @return Country|null
*/
public function getCountry(): ?Country
{
return $this->country;
}
/**
* @param Country|null $country
*/
public function setCountry(?Country $country): void
{
$this->country = $country;
}
/**
* @return Region|null
*/
public function getRegion(): ?Region
{
return $this->region;
}
/**
* @param Region|null $region
*/
public function setRegion(?Region $region): void
{
$this->region = $region;
}
/**
* @return Passport
*/
public function getPassport(): Passport
{
return $this->passport;
}
/**
* @param Passport $passport
*/
public function setPassport(Passport $passport): void
{
$this->passport = $passport;
}
/**
* @return string|null
*/
public function getEducation(): ?string
{
return $this->education;
}
/**
* @param string|null $education
*/
public function setEducation(?string $education): void
{
$this->education = $education;
}
/**
* @return string|null
*/
public function getAddressRegistration(): ?string
{
return $this->addressRegistration;
}
/**
* @param string|null $addressRegistration
*/
public function setAddressRegistration(?string $addressRegistration): void
{
$this->addressRegistration = $addressRegistration;
}
/**
* @return string|null
*/
public function getAddressFact(): ?string
{
return $this->addressFact;
}
/**
* @param string|null $addressFact
*/
public function setAddressFact(?string $addressFact): void
{
$this->addressFact = $addressFact;
}
/**
* @return bool
*/
public function isTestData(): bool
{
return $this->test_data;
}
/**
* @param bool $test_data
*/
public function setTestData(bool $test_data): void
{
$this->test_data = $test_data;
}
/**
* @return string|null
*/
public function getWorkPlace(): ?string
{
return $this->workPlace;
}
/**
* @param string|null $workPlace
*/
public function setWorkPlace(?string $workPlace): void
{
$this->workPlace = $workPlace;
}
/**
* @return string|null
*/
public function getWorkPosition(): ?string
{
return $this->workPosition;
}
/**
* @param string|null $workPosition
*/
public function setWorkPosition(?string $workPosition): void
{
$this->workPosition = $workPosition;
}
/**
* @return Event
*/
public function getEvent(): Event
{
return $this->event;
}
/**
* @param Event $event
*/
public function setEvent(Event $event): void
{
$this->event = $event;
}
/**
* @return User|null
*/
public function getUser(): ?User
{
return $this->user;
}
/**
* @param User|null $user
*/
public function setUser(?User $user): void
{
$this->user = $user;
}
/**
* @return bool
*/
public function isCanceled(): bool
{
return $this->canceled;
}
/**
* @param bool $canceled
*/
public function setCanceled(bool $canceled): void
{
$this->canceled = $canceled;
}
/**
* @return string
*/
public function getUuid(): string
{
return $this->uuid;
}
/**
* @param string $uuid
*/
public function setUuid(string $uuid): void
{
$this->uuid = $uuid;
}
/**
* @return Collection
*/
public function getParticipants()
{
return $this->participants;
}
/**
* @param Collection $participants
*/
public function setParticipants($participants): void
{
$this->participants = $participants;
}
/**
* @return \DateTime|null
*/
public function getBirthday(): ?\Datetime
{
return $this->birthday;
}
/**
* @param \DateTime|null $birthday
*/
public function setBirthday(?\Datetime $birthday): void
{
$this->birthday = $birthday;
}
/**
* @return string|null
*/
public function getAllergy(): ?string
{
return $this->allergy;
}
/**
* @param string|null $allergy
*/
public function setAllergy(?string $allergy): void
{
$this->allergy = $allergy;
}
}