<?php

namespace App\Entity;

use App\Repository\YearRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass=YearRepository::class)
 */
class Year
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $debut;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $debut2;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $finfocal;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $findpp;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $finfocal2;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $findpp2;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $rapport=false;

     /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $publierpta=false;

    /**
     * @ORM\Column(type="string", length=4, unique=true)
     */
    private $name;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $rapport_suivi;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $rapport_indicateurs;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $rapportpta;

    /**
     * @ORM\OneToMany(targetEntity=Rapport::class, mappedBy="year")
     */
    private $rapports;

    /**
     * @ORM\OneToMany(targetEntity=ValeurSousIndicateur::class, mappedBy="year")
     */
    private $valeurSousIndicateurs;

    public function __construct()
    {
        $this->rapports = new ArrayCollection();
        $this->valeurSousIndicateurs = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getDebut(): ?\DateTimeInterface
    {
        return $this->debut;
    }

    public function setDebut(?\DateTimeInterface $debut): self
    {
        $this->debut = $debut;

        return $this;
    }

    public function getDebut2(): ?\DateTimeInterface
    {
        return $this->debut2;
    }

    public function setDebut2(?\DateTimeInterface $debut2): self
    {
        $this->debut2 = $debut2;

        return $this;
    }

    public function getFinfocal(): ?\DateTimeInterface
    {
        return $this->finfocal;
    }

    public function setFinfocal(?\DateTimeInterface $finfocal): self
    {
        $this->finfocal = $finfocal;

        return $this;
    }

    public function getFindpp(): ?\DateTimeInterface
    {
        return $this->findpp;
    }

    public function setFindpp(?\DateTimeInterface $findpp): self
    {
        $this->findpp = $findpp;

        return $this;
    }

    public function getFinfocal2(): ?\DateTimeInterface
    {
        return $this->finfocal2;
    }

    public function setFinfocal2(?\DateTimeInterface $finfocal2): self
    {
        $this->finfocal2 = $finfocal2;

        return $this;
    }

    public function getFindpp2(): ?\DateTimeInterface
    {
        return $this->findpp2;
    }

    public function setFindpp2(?\DateTimeInterface $findpp2): self
    {
        $this->findpp2 = $findpp2;

        return $this;
    }

    public function getRapport(): ?bool
    {
        return $this->rapport;
    }

    public function setRapport(?bool $rapport): self
    {
        $this->rapport = $rapport;

        return $this;
    }

    public function getPublierPTA(): ?bool
    {
        return $this->publierpta;
    }

    public function setPublierPTA(?bool $publierpta): self
    {
        $this->publierpta = $publierpta;
        return $this;
    }

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

    public function getMoyenne(): ?string
    {
        return $this->moyenne;
    }

    public function setMoyenne(string $moyenne): self
    {
        $this->moyenne = $moyenne;

        return $this;
    }

     /**
     * @ORM\Column(type="string")
     */
    private $moyenne;

    public function getRapportSuivi(): ?string
    {
        return $this->rapport_suivi;
    }

    public function setRapportSuivi(?string $rapport_suivi): self
    {
        $this->rapport_suivi = $rapport_suivi;

        return $this;
    }

    public function getRapportIndicateurs(): ?string
    {
        return $this->rapport_indicateurs;
    }

    public function setRapportIndicateurs(?string $rapport_indicateurs): self
    {
        $this->rapport_indicateurs = $rapport_indicateurs;

        return $this;
    }

    public function getRapportPTA(): ?string
    {
        return $this->rapportpta;
    }

    public function setRapportPTA(?string $rapportpta): self
    {
        $this->rapportpta = $rapportpta;

        return $this;
    }

    /**
     * @return Collection<int, Rapport>
     */
    public function getRapports(): Collection
    {
        return $this->rapports;
    }

    public function addRapport(Rapport $rapport): self
    {
        if (!$this->rapports->contains($rapport)) {
            $this->rapports[] = $rapport;
            $rapport->setYear($this);
        }

        return $this;
    }

    public function removeRapport(Rapport $rapport): self
    {
        if ($this->rapports->removeElement($rapport)) {
            // set the owning side to null (unless already changed)
            if ($rapport->getYear() === $this) {
                $rapport->setYear(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, ValeurSousIndicateur>
     */
    public function getValeurSousIndicateurs(): Collection
    {
        return $this->valeurSousIndicateurs;
    }

    public function addValeurSousIndicateur(ValeurSousIndicateur $valeurSousIndicateur): self
    {
        if (!$this->valeurSousIndicateurs->contains($valeurSousIndicateur)) {
            $this->valeurSousIndicateurs[] = $valeurSousIndicateur;
            $valeurSousIndicateur->setYear($this);
        }

        return $this;
    }

    public function removeValeurSousIndicateur(ValeurSousIndicateur $valeurSousIndicateur): self
    {
        if ($this->valeurSousIndicateurs->removeElement($valeurSousIndicateur)) {
            // set the owning side to null (unless already changed)
            if ($valeurSousIndicateur->getYear() === $this) {
                $valeurSousIndicateur->setYear(null);
            }
        }

        return $this;
    }
}
