src/Entity/Geo/Region.php line 16
<?php
namespace App\Entity\Geo;
use App\Entity\Traits\ActiveTrait;
use App\Entity\Traits\TrackerFields;
use App\Entity\Traits\UserCreatedInterface;
use App\Entity\Traits\UserUpdatedInterface;
use App\Model\Translation\TranslatableTrait;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
#[ORM\Table(name: 'federal_region')]
#[ORM\Entity(repositoryClass: 'App\Repository\Geo\RegionRepository')]
#[ORM\HasLifecycleCallbacks]
class Region implements UserCreatedInterface, UserUpdatedInterface, TranslatableInterface
{
use TrackerFields;
use ActiveTrait;
use TranslatableTrait;
/**
* @var ?int
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var ?string
*/
#[ORM\Column(type: 'string', nullable: true)]
private $caption;
/**
* @var int
*/
#[ORM\Column(type: 'integer', nullable: false, options: ['default' => 10])]
private $weight = 10;
/**
* @var int
*/
#[ORM\Column(type: 'integer', nullable: false, options: ['default' => 10])]
private int $weight_flat = 10;
/**
* @var ?string
*/
#[ORM\Column(type: 'string', nullable: true)]
private $short_caption;
/**
* @var ?District
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Geo\District', inversedBy: 'regions')]
#[ORM\JoinColumn(nullable: false)]
private $district;
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getCaption(): ?string
{
return $this->translate()->getCaption();
}
/**
* @return int
*/
public function getWeight(): int
{
return $this->weight;
}
/**
* @param int $weight
*/
public function setWeight(int $weight): void
{
$this->weight = $weight;
}
/**
* @return string|null
*/
public function getShortCaption(): ?string
{
return $this->short_caption;
}
/**
* @param string|null $short_caption
*/
public function setShortCaption(?string $short_caption): void
{
$this->short_caption = $short_caption;
}
/**
* @return District|null
*/
public function getDistrict(): ?District
{
return $this->district;
}
/**
* @param District|null $district
*/
public function setDistrict(?District $district): void
{
$this->district = $district;
}
/**
* @return int
*/
public function getWeightFlat(): int
{
return $this->weight_flat;
}
/**
* @param int $weight_flat
*/
public function setWeightFlat(int $weight_flat): void
{
$this->weight_flat = $weight_flat;
}
}