src/Entity/Region.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\Interfaces\SiteInterface;
  5. use App\Entity\Traits\NameTrait;
  6. use App\Entity\Traits\SiteTrait;
  7. use App\Repository\RegionRepository;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. /**
  11.  * @ORM\Table(name="vulco_region", indexes={@ORM\Index(name="region_site_idx", columns={"site"})})
  12.  * @ORM\Entity(repositoryClass=RegionRepository::class)
  13.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  14.  * @SiteAware(siteFieldName="site")
  15.  */
  16. class Region extends AbstractBase implements SiteInterface
  17. {
  18.     use SiteTrait;
  19.     use NameTrait;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, nullable=false)
  22.      */
  23.     private string $name;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true)
  26.      */
  27.     private string $code;
  28.     public function getCode(): string
  29.     {
  30.         return $this->code;
  31.     }
  32.     public function setCode(string $code): self
  33.     {
  34.         $this->code $code;
  35.         return $this;
  36.     }
  37.     public function __toString(): string
  38.     {
  39.         return $this->id $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  40.     }
  41. }