src/Entity/Region.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RegionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassRegionRepository::class)]
  6. class Region
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private ?int $id;
  12.     #[ORM\Column(type'string'length255)]
  13.     private ?string $name;
  14.     #[ORM\Column(type'string'length255)]
  15.     private ?string $establishment;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private ?string $email;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private ?string $phone;
  20.     #[ORM\ManyToOne(targetEntityAddressRegion::class, inversedBy'regions')]
  21.     private ?AddressRegion $addressRegion;
  22.     public function getCode(): ?int
  23.     {
  24.         return $this->getAddressRegion()->getCode();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getName(): ?string
  31.     {
  32.         return $this->name;
  33.     }
  34.     public function setName(string $name): self
  35.     {
  36.         $this->name $name;
  37.         return $this;
  38.     }
  39.     public function getEstablishment(): ?string
  40.     {
  41.         return $this->establishment;
  42.     }
  43.     public function setEstablishment(string $establishment): self
  44.     {
  45.         $this->establishment $establishment;
  46.         return $this;
  47.     }
  48.     public function getEmail(): ?string
  49.     {
  50.         return $this->email;
  51.     }
  52.     public function setEmail(?string $email): self
  53.     {
  54.         $this->email $email;
  55.         return $this;
  56.     }
  57.     public function getPhone(): ?string
  58.     {
  59.         return $this->phone;
  60.     }
  61.     public function setPhone(?string $phone): self
  62.     {
  63.         $this->phone $phone;
  64.         return $this;
  65.     }
  66.     public function getAddressRegion(): ?AddressRegion
  67.     {
  68.         return $this->addressRegion;
  69.     }
  70.     public function setAddressRegion(?AddressRegion $addressRegion): self
  71.     {
  72.         $this->addressRegion $addressRegion;
  73.         return $this;
  74.     }
  75. }