<?php

namespace App\Entity;

use App\Repository\AnomalieOracleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Ignore;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ORM\Entity(repositoryClass=AnomalieOracleRepository::class)
 * @ORM\Table(schema="sav")
 */
class AnomalieOracle
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     * @Groups({"api"})
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=60, nullable=true)
     * @Groups({"api"})
     */
    private $libelle;

    /**
     * @ORM\Column(type="integer", nullable=true)
     * @Groups({"api"})
     */
    private $classe;

    /**
     * @ORM\Column(type="string", length=70, nullable=true)
     * @Groups({"api"})
     */
    private $annotation;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     * @Groups({"api"})
     */
    private $flag_contrat;

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

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

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

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

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

    /**
     * @ORM\OneToMany(targetEntity=InterventionAnomalie::class, mappedBy="anomalie_oracle")
     */
    private $interventionAnomaliesOracle;

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

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

    public function getLibelle(): ?string
    {
        return $this->libelle;
    }

    public function setLibelle(?string $libelle): self
    {
        $this->libelle = $libelle;

        return $this;
    }

    public function getClasse(): ?int
    {
        return $this->classe;
    }

    public function setClasse(?int $classe): self
    {
        $this->classe = $classe;

        return $this;
    }

    public function getAnnotation(): ?string
    {
        return $this->annotation;
    }

    public function setAnnotation(?string $annotation): self
    {
        $this->annotation = $annotation;

        return $this;
    }

    public function getFlagContrat(): ?bool
    {
        return $this->flag_contrat;
    }

    public function setFlagContrat(?bool $flag_contrat): self
    {
        $this->flag_contrat = $flag_contrat;

        return $this;
    }

    public function getCourrierSouscripteur(): ?string
    {
        return $this->courrier_souscripteur;
    }

    public function setCourrierSouscripteur(?string $courrier_souscripteur): self
    {
        $this->courrier_souscripteur = $courrier_souscripteur;

        return $this;
    }

    public function getCourrierUtilisateur(): ?string
    {
        return $this->courrier_utilisateur;
    }

    public function setCourrierUtilisateur(?string $courrier_utilisateur): self
    {
        $this->courrier_utilisateur = $courrier_utilisateur;

        return $this;
    }

    public function getCourrierInstallateur(): ?string
    {
        return $this->courrier_installateur;
    }

    public function setCourrierInstallateur(?string $courrier_installateur): self
    {
        $this->courrier_installateur = $courrier_installateur;

        return $this;
    }

    public function getHierarchie(): ?int
    {
        return $this->hierarchie;
    }

    public function setHierarchie(?int $hierarchie): self
    {
        $this->hierarchie = $hierarchie;

        return $this;
    }

    public function getParagraphe(): ?string
    {
        return $this->paragraphe;
    }

    public function setParagraphe(?string $paragraphe): self
    {
        $this->paragraphe = $paragraphe;

        return $this;
    }

    /**
     * @return Collection<int, InterventionAnomalie>
     */
    public function getInterventionAnomaliesOracle(): Collection
    {
        return $this->interventionAnomaliesOracle;
    }

    public function addInterventionAnomalieOracle(InterventionAnomalie $interventionAnomalieOracle): self
    {
        if (!$this->interventionAnomaliesOracle->contains($interventionAnomalieOracle)) {
            $this->interventionAnomaliesOracle[] = $interventionAnomalieOracle;
            $interventionAnomalieOracle->setAnomalie($this);
        }

        return $this;
    }

    public function removeInterventionAnomalieOracle(InterventionAnomalie $interventionAnomalieOracle): self
    {
        if ($this->interventionAnomaliesOracle->removeElement($interventionAnomalieOracle)) {
            // set the owning side to null (unless already changed)
            if ($interventionAnomalieOracle->getAnomalie() === $this) {
                $interventionAnomalieOracle->setAnomalie(null);
            }
        }

        return $this;
    }
}
