src/Entity/DocumentStatus.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity()
  6.  * @ORM\Table(name="document_status")
  7.  */
  8. class DocumentStatus
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private ?int $id null;
  16.     /**
  17.      * @ORM\Column(type="string", length=64, unique=true)
  18.      */
  19.     private ?string $name null// nom technique (ex: 'rembourse')
  20.     /**
  21.      * @ORM\Column(type="string", length=128)
  22.      */
  23.     private ?string $labelFr null// label FR (ex: 'Remboursé')
  24.     /**
  25.      * @ORM\Column(type="text", nullable=true)
  26.      */
  27.     private ?string $description null;
  28.     // -- Getters & setters --
  29.     public function getId(): ?int { return $this->id; }
  30.     public function getName(): ?string { return $this->name; }
  31.     public function setName(string $name): self $this->name $name; return $this; }
  32.     public function getLabelFr(): ?string { return $this->labelFr; }
  33.     public function setLabelFr(string $labelFr): self $this->labelFr $labelFr; return $this; }
  34.     public function getDescription(): ?string { return $this->description; }
  35.     public function setDescription(?string $desc): self $this->description $desc; return $this; }
  36.     public function __toString(): string
  37.     {
  38.         return $this->labelFr ?? $this->name ?? '';
  39.     }
  40. }