<?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 Symfony\Component\Serializer\Annotation\Groups;/** * SpecialiteLaboratoire * * @ORM\Table() * @UniqueEntity("label") * @ORM\Entity(repositoryClass="App\Repository\SpecialiteLaboratoireRepository") * @ApiResource(attributes={ * "pagination_client_items_per_page"=true, * "filters"={"specialite_laboratoire.order", "specialite_laboratoire.boolean"}, * "normalization_context"={"groups"={"read"}}, * "denormalization_context"={"groups"={"write"}} * }) */class SpecialiteLaboratoire{ /** * @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="actif", type="boolean") * @Groups({"read"}) */ private $actif; /** * Constructor of SpecialiteLaboratoire Entity */ public function __construct() { $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 SpecialiteLaboratoire */ 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 SpecialiteLaboratoire */ public function setActif($actif) { $this->actif = $actif; return $this; }}