<?php

namespace App\Entity;

use App\Repository\InterventionAnnulationRepository;
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=InterventionAnnulationRepository::class)
 * @ORM\Table(schema="sav")
 */
class InterventionAnnulation
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     * @Groups({"api"})
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity=InterventionMotifAnnulation::class, inversedBy="interventionAnnulations")
     * @ORM\JoinColumn(name="idintervention_motif_annulation")
     * @Groups({"api"})
     */
    private $intervention_motif_annulation;

    /**
     * @ORM\ManyToOne(targetEntity=InterventionMotifAbsence::class, inversedBy="interventionAnnulations")
     * @ORM\JoinColumn(name="idintervention_motif_absence")
     */
    private $intervention_motif_absence;

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

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

    /**
     * @ORM\ManyToOne(targetEntity=InterventionMotifAbandon::class, inversedBy="interventionAnnulations")
     * @ORM\JoinColumn(name="idintervention_motif_abandon")
     * @Groups({"api"})
     */
    private $intervention_motif_abandon;

    /**
     * @ORM\ManyToOne(targetEntity=Intervention::class, inversedBy="interventionAnnulations")
     * @ORM\JoinColumn(name="idintervention")
     */
    private $intervention;

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

    public function getInterventionMotifAnnulation(): ?InterventionMotifAnnulation
    {
        return $this->intervention_motif_annulation;
    }

    public function setInterventionMotifAnnulation(?InterventionMotifAnnulation $intervention_motif_annulation): self
    {
        $this->intervention_motif_annulation = $intervention_motif_annulation;

        return $this;
    }

    public function getInterventionMotifAbsence(): ?InterventionMotifAbsence
    {
        return $this->intervention_motif_absence;
    }

    public function setInterventionMotifAbsence(?InterventionMotifAbsence $intervention_motif_absence): self
    {
        $this->intervention_motif_absence = $intervention_motif_absence;

        return $this;
    }

    public function getAutreMotif(): ?string
    {
        return $this->autre_motif;
    }

    public function setAutreMotif(?string $autre_motif): self
    {
        $this->autre_motif = $autre_motif;

        return $this;
    }

    public function getObservations(): ?string
    {
        return $this->observations;
    }

    public function setObservations(?string $observations): self
    {
        $this->observations = $observations;

        return $this;
    }

    public function getInterventionMotifAbandon(): ?InterventionMotifAbandon
    {
        return $this->intervention_motif_abandon;
    }

    public function setInterventionMotifAbandon(?InterventionMotifAbandon $intervention_motif_abandon): self
    {
        $this->intervention_motif_abandon = $intervention_motif_abandon;

        return $this;
    }

    public function getIntervention(): ?Intervention
    {
        return $this->intervention;
    }

    public function setIntervention(?Intervention $intervention): self
    {
        $this->intervention = $intervention;

        return $this;
    }
}
