<?php

namespace App\Entity;

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

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

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

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

    /**
     * @ORM\ManyToOne(targetEntity=TypeTel::class, inversedBy="clientTels")
     * @ORM\JoinColumn(name="idtype_tel")
     */
    private $type_tel;

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

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

    /**
     * @Groups({"api"})
     */
    private $statut;

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

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

    public function setId(?int $id): self
    {
        $this->id = $id;

        return $this;
    }

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

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

        return $this;
    }

    public function getNumTel(): ?string
    {
        return $this->num_tel;
    }

    public function setNumTel(?string $num_tel): self
    {
        $this->num_tel = $num_tel;

        return $this;
    }

    public function getTypeTel(): ?TypeTel
    {
        return $this->type_tel;
    }

    public function setTypeTel(?TypeTel $type_tel): self
    {
        $this->type_tel = $type_tel;

        return $this;
    }

    public function getCommentaireTel(): ?string
    {
        return $this->commentaire_tel;
    }

    public function setCommentaireTel(?string $commentaire_tel): self
    {
        $this->commentaire_tel = $commentaire_tel;

        return $this;
    }

    public function getPriorite(): ?int
    {
        return $this->priorite;
    }

    public function setPriorite(?int $priorite): self
    {
        $this->priorite = $priorite;

        return $this;
    }

    public function __toString() {
        return $this->getNumTel();
    }

    public function getStatut()
    {
        return $this->statut;
    }

    public function setStatut($statut): self
    {
        $this->statut = $statut;

        return $this;
    }

    public function getFr(): ?bool
    {
        return $this->fr;
    }

    public function setFr(?bool $fr): self
    {
        $this->fr = $fr;

        return $this;
    }
}
