src/Entity/Olympiad/Online/Category.php line 22
<?php
namespace App\Entity\Olympiad\Online;
use App\Entity\Common\DateInterval;
use App\Entity\Common\DateTimeInterval;
use App\Entity\Common\TimeInterval;
use App\Entity\Traits\ActiveTrait;
use App\Entity\Traits\TrackerFields;
use App\Entity\Traits\UserCreatedInterface;
use App\Entity\Traits\UserUpdatedInterface;
use App\Entity\Traits\WeightTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
use App\Model\Translation\TranslatableTrait;
#[ORM\Table(name: 'olymp_online_category')]
#[ORM\Entity(repositoryClass: 'App\Repository\Olympiad\Online\CategoryRepository')]
#[ORM\HasLifecycleCallbacks]
class Category implements UserCreatedInterface, UserUpdatedInterface, TranslatableInterface
{
use TrackerFields;
use WeightTrait;
use ActiveTrait;
use TranslatableTrait;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', nullable: true)]
private $caption;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', nullable: true)]
private ?string $apply_button = null;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', nullable: true)]
private ?string $forceLocale = null;
#[ORM\Column(type: 'boolean', options: ['default' => true])]
private bool $registration_enable = true;
/**
* @var DateTimeInterval
*/
#[ORM\Embedded(class: 'App\Entity\Common\DateTimeInterval', columnPrefix: 'ro_')]
private DateTimeInterval $registration_open;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Olympiad\Online\Event', inversedBy: 'categories')]
#[ORM\JoinColumn(nullable: false)]
private Event $event;
/**
* @var DateInterval
*/
#[ORM\Embedded(class: 'App\Entity\Common\DateInterval', columnPrefix: 'di_')]
private DateInterval $interval;
/**
* @var TimeInterval
*/
#[ORM\Embedded(class: 'App\Entity\Common\TimeInterval', columnPrefix: 'ti_')]
private TimeInterval $timeInterval;
/**
* @var Collection
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\Olympiad\Online\Direction', mappedBy: 'category')]
private Collection $directions;
/**
* @var string|null
*/
#[ORM\Column(type: 'text', nullable: true)]
private ?string $apply_description = null;
/**
* @var array
*/
#[ORM\Column(type: 'json', nullable: true)]
private ?array $participantTypes = [Participant::TYPE_SCHOOL, Participant::TYPE_STUDENT];
/**
* @var array
*/
#[ORM\Column(type: 'json', nullable: true)]
private ?array $countries = [];
/**
* @var array
*/
#[ORM\Column(type: 'json', nullable: true)]
private ?array $federal_districts = [];
#[ORM\OneToMany(targetEntity: 'App\Entity\Olympiad\Online\CourseOverride', mappedBy: 'category')]
private Collection $courseOverrides;
public function __construct()
{
$this->interval = new DateInterval();
$this->registration_open = new DateTimeInterval();
$this->timeInterval = new TimeInterval();
$this->courseOverrides = new ArrayCollection();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id): void
{
$this->id = $id;
}
/**
* @return mixed
*/
// public function getCaption()
// {
// return $this->translate()->getCaption();
// }
/**
* @return DateTimeInterval
*/
public function getRegistrationOpen(): DateTimeInterval
{
return $this->registration_open;
}
/**
* @param DateTimeInterval $registration_open
*/
public function setRegistrationOpen(DateTimeInterval $registration_open): void
{
$this->registration_open = $registration_open;
}
/**
* @return Event
*/
public function getEvent(): Event
{
return $this->event;
}
/**
* @param Event $event
*/
public function setEvent(Event $event): void
{
$this->event = $event;
}
/**
* @return DateInterval
*/
public function getInterval(): DateInterval
{
return $this->interval;
}
/**
* @param DateInterval $interval
*/
public function setInterval(DateInterval $interval): void
{
$this->interval = $interval;
}
/**
* @return TimeInterval
*/
public function getTimeInterval(): TimeInterval
{
return $this->timeInterval;
}
/**
* @param TimeInterval $timeInterval
*/
public function setTimeInterval(TimeInterval $timeInterval): void
{
$this->timeInterval = $timeInterval;
}
/**
* @return Collection<Direction>
*/
public function getDirections(): Collection
{
return $this->directions;
}
/**
* @param Collection $directions
*/
public function setDirections(Collection $directions): void
{
$this->directions = $directions;
}
/**
* @return array
*/
public function getParticipantTypes(): ?array
{
return $this->participantTypes;
}
/**
* @param array $participantTypes
*/
public function setParticipantTypes(?array $participantTypes): void
{
$this->participantTypes = $participantTypes;
}
/**
* @return array
*/
public function getCountries(): ?array
{
return $this->countries;
}
/**
* @param array $countries
*/
public function setCountries(?array $countries): void
{
$this->countries = $countries;
}
/**
* @return array
*/
public function getFederalDistricts(): ?array
{
return $this->federal_districts;
}
/**
* @param array $federal_districts
*/
public function setFederalDistricts(?array $federal_districts): void
{
$this->federal_districts = $federal_districts;
}
/**
* @return string|null
*/
public function getForceLocale(): ?string
{
return $this->forceLocale;
}
/**
* @param string|null $forceLocale
*/
public function setForceLocale(?string $forceLocale): void
{
$this->forceLocale = $forceLocale;
}
/**
* @return bool
*/
public function isRegistrationEnable(): bool
{
return $this->registration_enable;
}
/**
* @param bool $registration_enable
*/
public function setRegistrationEnable(bool $registration_enable): void
{
$this->registration_enable = $registration_enable;
}
}