<?php
namespace App\Entity;
use App\Repository\TrancheAgeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TrancheAgeRepository::class)]
class TrancheAge
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $agemin = null;
#[ORM\Column]
private ?int $agemax = null;
#[ORM\Column(length: 255)]
private ?string $trancheage = null;
#[ORM\OneToMany(mappedBy: 'trancheage', targetEntity: Programme::class)]
private Collection $programmes;
public function __construct()
{
$this->programmes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getAgemin(): ?int
{
return $this->agemin;
}
public function setAgemin(int $agemin): self
{
$this->agemin = $agemin;
return $this;
}
public function getAgemax(): ?int
{
return $this->agemax;
}
public function setAgemax(int $agemax): self
{
$this->agemax = $agemax;
return $this;
}
public function getTrancheage(): ?string
{
return $this->trancheage;
}
public function setTrancheage(string $trancheage): self
{
$this->trancheage = $trancheage;
return $this;
}
/**
* @return Collection<int, Programme>
*/
public function getProgrammes(): Collection
{
return $this->programmes;
}
public function addProgramme(Programme $programme): self
{
if (!$this->programmes->contains($programme)) {
$this->programmes->add($programme);
$programme->setTrancheage($this);
}
return $this;
}
public function removeProgramme(Programme $programme): self
{
if ($this->programmes->removeElement($programme)) {
// set the owning side to null (unless already changed)
if ($programme->getTrancheage() === $this) {
$programme->setTrancheage(null);
}
}
return $this;
}
}