<?php

namespace App\Entity;

use App\Repository\AgenceAdresseRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ORM\Entity(repositoryClass=AgenceAdresseRepository::class)
 * @ORM\Table(schema="sav")
 */
class AgenceAdresse
{

    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity=Agence::class, inversedBy="agenceAdresses")
     * @ORM\JoinColumn(nullable=false, name="idagence")
     * @Groups({"api"})
     */
    private $agence;

    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity=Adresse::class, inversedBy="agenceAdresses")
     * @ORM\JoinColumn(nullable=false, name="idadresse")
     * @Groups({"api"})
     */
    private $adresse;

    /**
     * @ORM\Column(type="boolean")
     * @Groups({"api"})
     */
    private $actif;

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

    public function getAgence(): ?Agence
    {
        return $this->agence;
    }

    public function setAgence(?Agence $agence): self
    {
        $this->agence = $agence;

        return $this;
    }

    public function getAdresse(): ?Adresse
    {
        return $this->adresse;
    }

    public function setAdresse(?Adresse $adresse): self
    {
        $this->adresse = $adresse;

        return $this;
    }

    public function getActif(): ?bool
    {
        return $this->actif;
    }

    public function setActif(bool $actif): self
    {
        $this->actif = $actif;

        return $this;
    }
}
