<?php
namespace App\Entity;
use App\Annotation\SiteAware;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\SiteTrait;
use App\Repository\RegionRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table(name="vulco_region", indexes={@ORM\Index(name="region_site_idx", columns={"site"})})
* @ORM\Entity(repositoryClass=RegionRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @SiteAware(siteFieldName="site")
*/
class Region extends AbstractBase implements SiteInterface
{
use SiteTrait;
use NameTrait;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private string $code;
public function getCode(): string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function __toString(): string
{
return $this->id ? $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}