<?php
namespace App\Entity;
use App\Repository\AlertRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AlertRepository::class)]
class Alert
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $place;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $begin;
#[ORM\Column(type: 'boolean')]
private $emailActivated;
#[ORM\ManyToMany(targetEntity: Sport::class)]
private $sports;
#[ORM\ManyToOne(targetEntity: Trainee::class, inversedBy: 'alerts')]
private $trainee;
#[ORM\ManyToMany(targetEntity: Level::class)]
private $levels;
#[ORM\ManyToMany(targetEntity: Language::class)]
private $languages;
#[ORM\ManyToMany(targetEntity: Age::class)]
private $ages;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $countryCode;
#[ORM\Column(type: 'string', length: 255)]
private $title;
#[ORM\Column(length: 255, nullable: true)]
private ?string $placeName = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
public function __construct()
{
$this->sports = new ArrayCollection();
$this->levels = new ArrayCollection();
$this->languages = new ArrayCollection();
$this->ages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPlace(): ?string
{
return $this->place;
}
public function setPlace(?string $place): self
{
$this->place = $place;
return $this;
}
public function getBegin(): ?string
{
return $this->begin;
}
public function setBegin(?string $begin): self
{
$this->begin = $begin;
return $this;
}
public function getEmailActivated(): ?bool
{
return $this->emailActivated;
}
public function setEmailActivated(bool $emailActivated): self
{
$this->emailActivated = $emailActivated;
return $this;
}
/**
* @return Collection|Sport[]
*/
public function getSports(): Collection
{
return $this->sports;
}
public function addSport(Sport $sport): self
{
if (!$this->sports->contains($sport)) {
$this->sports[] = $sport;
}
return $this;
}
public function removeSport(Sport $sport): self
{
$this->sports->removeElement($sport);
return $this;
}
public function getTrainee(): ?Trainee
{
return $this->trainee;
}
public function setTrainee(?Trainee $trainee): self
{
$this->trainee = $trainee;
return $this;
}
/**
* @return Collection|Level[]
*/
public function getLevels(): Collection
{
return $this->levels;
}
public function addLevel(Level $level): self
{
if (!$this->levels->contains($level)) {
$this->levels[] = $level;
}
return $this;
}
public function removeLevel(Level $level): self
{
$this->levels->removeElement($level);
return $this;
}
/**
* @return Collection|Language[]
*/
public function getLanguages(): Collection
{
return $this->languages;
}
public function addLanguage(Language $language): self
{
if (!$this->languages->contains($language)) {
$this->languages[] = $language;
}
return $this;
}
public function removeLanguage(Language $language): self
{
$this->languages->removeElement($language);
return $this;
}
/**
* @return Collection|Age[]
*/
public function getAges(): Collection
{
return $this->ages;
}
public function addAge(Age $age): self
{
if (!$this->ages->contains($age)) {
$this->ages[] = $age;
}
return $this;
}
public function removeAge(Age $age): self
{
$this->ages->removeElement($age);
return $this;
}
public function getCountryCode(): ?string
{
return $this->countryCode;
}
public function setCountryCode(?string $countryCode): self
{
$this->countryCode = $countryCode;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getPlaceName(): ?string
{
return $this->placeName;
}
public function setPlaceName(?string $placeName): static
{
$this->placeName = $placeName;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
}