<?php
namespace App\Entity;
use App\Repository\SchoolActivityRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SchoolActivityRepository::class)]
class SchoolActivity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $duration;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $periodes;
#[ORM\ManyToMany(targetEntity: ClassLevel::class, inversedBy: 'schoolActivities')]
private $classLevels;
#[ORM\OneToOne(targetEntity: Activity::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private $activity;
#[ORM\ManyToOne(targetEntity: Theme::class, inversedBy: 'schoolActivities')]
#[ORM\JoinColumn(nullable: false)]
private $theme;
#[ORM\Column(type: 'text', nullable: true)]
private $primaryTimeAnimation;
#[ORM\Column(type: 'text', nullable: true)]
private $maternelTimeAnimation;
#[ORM\Column(type: 'datetime', nullable: true)]
private $dateEnd;
#[ORM\Column(type: 'decimal', precision: 5, scale: 2)]
private $normalPrice;
#[ORM\Column(type: 'decimal', precision: 5, scale: 2)]
private $jettePrice;
#[ORM\Column(type: 'datetime', nullable: true)]
private $dateJetteRegisterStart;
#[ORM\Column(type: 'datetime', nullable: true)]
private $dateJetteRegisterEnd;
#[ORM\OneToMany(mappedBy: 'activity', targetEntity: SchoolRegistration::class)]
private $schoolRegistrations;
public function __construct()
{
$this->classLevels = new ArrayCollection();
$this->schoolRegistrations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDuration(): ?string
{
return $this->duration;
}
public function setDuration(string $duration): self
{
$this->duration = $duration;
return $this;
}
public function getPeriodes(): ?string
{
return $this->periodes;
}
public function setPeriodes(?string $periodes): self
{
$this->periodes = $periodes;
return $this;
}
/**
* @return Collection<int, ClassLevel>
*/
public function getClassLevels(): Collection
{
return $this->classLevels;
}
public function addClassLevel(ClassLevel $classLevel): self
{
if (!$this->classLevels->contains($classLevel)) {
$this->classLevels[] = $classLevel;
}
return $this;
}
public function removeClassLevel(ClassLevel $classLevel): self
{
$this->classLevels->removeElement($classLevel);
return $this;
}
public function getActivity(): ?Activity
{
return $this->activity;
}
public function setActivity(Activity $activity): self
{
$this->activity = $activity;
return $this;
}
public function getTheme(): ?Theme
{
return $this->theme;
}
public function setTheme(?Theme $theme): self
{
$this->theme = $theme;
return $this;
}
public function getNormalPrice(): ?string
{
return $this->normalPrice;
}
public function setNormalPrice(string $normalPrice): self
{
$this->normalPrice = $normalPrice;
return $this;
}
public function getJettePrice(): ?string
{
return $this->jettePrice;
}
public function setJettePrice(string $jettePrice): self
{
$this->jettePrice = $jettePrice;
return $this;
}
public function getDateJetteRegisterStart(): ?\DateTimeInterface
{
return $this->dateJetteRegisterStart;
}
public function setDateJetteRegisterStart(?\DateTimeInterface $dateJetteRegisterStart): self
{
$this->dateJetteRegisterStart = $dateJetteRegisterStart;
return $this;
}
public function getDateJetteRegisterEnd(): ?\DateTimeInterface
{
return $this->dateJetteRegisterEnd;
}
public function setDateJetteRegisterEnd(?\DateTimeInterface $dateJetteRegisterEnd): self
{
$this->dateJetteRegisterEnd = $dateJetteRegisterEnd;
return $this;
}
public function getPrimaryTimeAnimation(): ?string
{
return $this->primaryTimeAnimation;
}
public function setPrimaryTimeAnimation(?string $primaryTimeAnimation): self
{
$this->primaryTimeAnimation = $primaryTimeAnimation;
return $this;
}
public function getMaternelTimeAnimation(): ?string
{
return $this->maternelTimeAnimation;
}
public function setMaternelTimeAnimation(?string $maternelTimeAnimation): self
{
$this->maternelTimeAnimation = $maternelTimeAnimation;
return $this;
}
public function getDateEnd(): ?\DateTimeInterface
{
return $this->dateEnd;
}
public function setDateEnd(?\DateTimeInterface $dateEnd): self
{
$this->dateEnd = $dateEnd;
return $this;
}
/**
* @return Collection<int, SchoolRegistration>
*/
public function getSchoolRegistrations(): Collection
{
return $this->schoolRegistrations;
}
public function addSchoolRegistration(SchoolRegistration $schoolRegistration): self
{
if (!$this->schoolRegistrations->contains($schoolRegistration)) {
$this->schoolRegistrations[] = $schoolRegistration;
$schoolRegistration->setActivity($this);
}
return $this;
}
public function removeSchoolRegistration(SchoolRegistration $schoolRegistration): self
{
if ($this->schoolRegistrations->removeElement($schoolRegistration)) {
// set the owning side to null (unless already changed)
if ($schoolRegistration->getActivity() === $this) {
$schoolRegistration->setActivity(null);
}
}
return $this;
}
}