<?php

namespace App\Entity;

use App\Repository\PorteOuverteRepository;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass=PorteOuverteRepository::class)
 * @ORM\Table(schema="sav")
 */
class PorteOuverte
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="porteOuvertes")
     * @ORM\JoinColumn(name="idclient")
     */
    private $client;

    /**
     * @ORM\ManyToOne(targetEntity=Agence::class, inversedBy="porteOuvertes")
     * @ORM\JoinColumn(name="idagence")
     */
    private $agence;

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

    /**
     * @ORM\Column(type="boolean", nullable=true,  options={"default" = 1})
     */
    private $derniere_po;

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

    public function getClient(): ?Client
    {
        return $this->client;
    }

    public function setClient(?Client $client): self
    {
        $this->client = $client;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    public function getDernierePo()
    {
        return $this->derniere_po;
    }

    public function setDernierePo(?bool $derniere_po): self
    {
        $this->derniere_po = $derniere_po;

        return $this;
    }
}
