<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\PlanificationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PlanificationRepository::class)]
#[ApiResource]
class Planification
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $datedebut = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $duree = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prix = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prixpromo = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lienformation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $selectfor = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $intitule = null;
#[ORM\OneToMany(mappedBy: 'planification', targetEntity: Formation::class,cascade: ['remove'])]
private Collection $relation;
public function __construct()
{
$this->relation = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDatedebut(): ?\DateTimeInterface
{
return $this->datedebut;
}
public function setDatedebut(?\DateTimeInterface $datedebut): self
{
$this->datedebut = $datedebut;
return $this;
}
public function getDuree(): ?string
{
return $this->duree;
}
public function setDuree(?string $duree): self
{
$this->duree = $duree;
return $this;
}
public function getPrix(): ?string
{
return $this->prix;
}
public function setPrix(?string $prix): self
{
$this->prix = $prix;
return $this;
}
public function getPrixpromo(): ?string
{
return $this->prixpromo;
}
public function setPrixpromo(?string $prixpromo): self
{
$this->prixpromo = $prixpromo;
return $this;
}
public function getLienformation(): ?string
{
return $this->lienformation;
}
public function setLienformation(?string $lienformation): self
{
$this->lienformation = $lienformation;
return $this;
}
public function getSelectfor(): ?string
{
return $this->selectfor;
}
public function setSelectfor(?string $selectfor): self
{
$this->selectfor = $selectfor;
return $this;
}
public function getIntitule(): ?string
{
return $this->intitule;
}
public function setIntitule(?string $intitule): self
{
$this->intitule = $intitule;
return $this;
}
/**
* @return Collection<int, Formation>
*/
public function getRelation(): Collection
{
return $this->relation;
}
public function addRelation(Formation $relation): self
{
if (!$this->relation->contains($relation)) {
$this->relation->add($relation);
$relation->setPlanification($this);
}
return $this;
}
public function removeRelation(Formation $relation): self
{
if ($this->relation->removeElement($relation)) {
// set the owning side to null (unless already changed)
if ($relation->getPlanification() === $this) {
$relation->setPlanification(null);
}
}
return $this;
}
}