<?php
/*
* This file is part of the kProjet project.
*
* (c) Kodiom <info@kodiom.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\SpecialiteDocteurRepository;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* SpecialiteDocteur
*
* @ORM\Table()
* @UniqueEntity("label")
* @ORM\Entity(repositoryClass=SpecialiteDocteurRepository::class)
* @ApiResource(attributes={
* "pagination_client_items_per_page"=true,
* "filters"={"specialite_docteur.order", "specialite_docteur.boolean"},
* "normalization_context"={"groups"={"read"}},
* "denormalization_context"={"groups"={"write"}}
* })
*/
class SpecialiteDocteur
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read"})
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="label", type="string", length=100)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $label;
/**
* @var bool
*
* @ORM\Column(name="generaliste", type="boolean")
* @Groups({"read"})
*/
private $generaliste;
/**
* @var bool
*
* @ORM\Column(name="urgentiste", type="boolean")
* @Groups({"read"})
*/
private $urgentiste;
/**
* @var bool
*
* @ORM\Column(name="visio", type="boolean")
* @Groups({"read"})
*/
private $visio;
/**
* @var bool
*
* @ORM\Column(name="actif", type="boolean")
* @Groups({"read"})
*/
private $actif;
/**
* @var string|null
*
* @ORM\Column(name="code", type="string", length=5, nullable=true)
*
* @Assert\IsNull(groups={"optional"})
* @Assert\Length(max=5)
* @Groups({"read"})
*/
private $code;
/**
* Constructor of SpecialiteDocteur Entity
*/
public function __construct()
{
$this->generaliste = false;
$this->urgentiste = false;
$this->visio = false;
$this->actif = true;
}
public function __toString()
{
return ($this->getLabel()) ? $this->getLabel() : '';
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get label
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set label
*
* @param string $label
*
* @return SpecialiteDocteur
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get actif
*
* @return boolean
*/
public function getActif()
{
return $this->actif;
}
/**
* Set actif
*
* @param bool $actif
*
* @return SpecialiteDocteur
*/
public function setActif($actif)
{
$this->actif = $actif;
return $this;
}
/**
* Get generaliste
*
* @return boolean
*/
public function getGeneraliste()
{
return $this->generaliste;
}
/**
* Set generaliste
*
* @param bool $generaliste
*
* @return SpecialiteDocteur
*/
public function setGeneraliste($generaliste)
{
$this->generaliste = $generaliste;
return $this;
}
/**
* Get urgentiste
*
* @return boolean
*/
public function getUrgentiste()
{
return $this->urgentiste;
}
/**
* Set urgentiste
*
* @param bool $urgentiste
*
* @return SpecialiteDocteur
*/
public function setUrgentiste($urgentiste)
{
$this->urgentiste = $urgentiste;
return $this;
}
/**
* Get visio
*
* @return boolean
*/
public function getVisio()
{
return $this->visio;
}
/**
* Set visio
*
* @param bool $visio
*
* @return SpecialiteDocteur
*/
public function setVisio($visio)
{
$this->visio = $visio;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
}