src/Entity/Departement.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\DepartementRepository;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. #[ORM\Entity(repositoryClassDepartementRepository::class)]
  7. class Departement
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $departmentNumber null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $departmentName null;
  17.     public function getId(): ?int
  18.     {
  19.         return $this->id;
  20.     }
  21.     public function getDepartmentName(): ?string
  22.     {
  23.         return $this->departmentName;
  24.     }
  25.     public function setDepartmentName(string $departmentName): self
  26.     {
  27.         $this->departmentName $departmentName;
  28.         return $this;
  29.     }
  30.     public function getDepartmentNumber(): ?string
  31.     {
  32.         return $this->departmentNumber;
  33.     }
  34.     public function setDepartmentNumber(string $departmentNumber): self
  35.     {
  36.         $this->departmentNumber $departmentNumber;
  37.         return $this;
  38.     }
  39.     public function __toString()
  40.     {
  41.         return ucwords(str_replace('-'' '$this->departmentName)) . " - " $this->departmentNumber;
  42.     }
  43. }