Files
backend/src/Entity/Promo.php
T
2026-06-03 18:38:00 +03:00

278 lines
6.0 KiB
PHP

<?php
namespace App\Entity;
use App\Entity\Behavior\UpdateTimestampTrait;
use App\Repository\PromoRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: PromoRepository::class)]
#[ORM\Table(name: 'promo')]
#[ORM\Index(name: 'idx_promo_region_id', columns: ['region_id'])]
#[ORM\Index(name: 'idx_promo_active', columns: ['active'])]
#[ORM\HasLifecycleCallbacks]
class Promo
{
use UpdateTimestampTrait;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "IDENTITY")]
#[ORM\Column(type: Types::INTEGER)]
#[Groups(['promo:read'])]
private ?int $id = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $name = null;
#[ORM\Column(type: Types::BOOLEAN, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?bool $active = null;
#[ORM\Column(name: 'region_id', type: Types::INTEGER, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?int $regionId = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $alias = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $anons = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $content = null;
#[ORM\Column(name: 'update_at', type: Types::DATETIME_IMMUTABLE, nullable: true)]
#[Groups(['promo:read'])]
private ?\DateTimeInterface $updateAt = null;
#[ORM\Column(type: 'jsonb', nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?array $clinics = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $timer = null;
#[ORM\Column(name: 'timer_bg', type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $timerBg = null;
#[ORM\Column(name: 'short_name', type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $shortName = null;
#[ORM\Column(name: 'link_services', type: 'jsonb', nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?array $linkServices = null;
#[ORM\Column(name: 'link_staff', type: 'jsonb', nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?array $linkStaff = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?string $period = null;
#[ORM\Column(type: 'jsonb', nullable: true)]
#[Groups(['promo:read', 'promo:write'])]
private ?array $photos = null;
public function getId(): ?int
{
return $this->id;
}
public function setId(?int $id): self
{
$this->id = $id;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): self
{
$this->active = $active;
return $this;
}
public function getRegionId(): ?int
{
return $this->regionId;
}
public function setRegionId(?int $regionId): self
{
$this->regionId = $regionId;
return $this;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(?string $alias): self
{
$this->alias = $alias;
return $this;
}
public function getAnons(): ?string
{
return $this->anons;
}
public function setAnons(?string $anons): self
{
$this->anons = $anons;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
public function getClinics(): ?array
{
return $this->clinics;
}
public function setClinics(?array $clinics): self
{
$this->clinics = $clinics;
return $this;
}
public function getTimer(): ?string
{
return $this->timer;
}
public function setTimer(?string $timer): self
{
$this->timer = $timer;
return $this;
}
public function getTimerBg(): ?string
{
return $this->timerBg;
}
public function setTimerBg(?string $timerBg): self
{
$this->timerBg = $timerBg;
return $this;
}
public function getShortName(): ?string
{
return $this->shortName;
}
public function setShortName(?string $shortName): self
{
$this->shortName = $shortName;
return $this;
}
public function getLinkServices(): ?array
{
return $this->linkServices;
}
public function setLinkServices(?array $linkServices): self
{
$this->linkServices = $linkServices;
return $this;
}
public function getLinkStaff(): ?array
{
return $this->linkStaff;
}
public function setLinkStaff(?array $linkStaff): self
{
$this->linkStaff = $linkStaff;
return $this;
}
public function getPeriod(): ?string
{
return $this->period;
}
public function setPeriod(?string $period): self
{
$this->period = $period;
return $this;
}
public function getPhotos(): ?array
{
return $this->photos;
}
public function setPhotos(?array $photos): self
{
$this->photos = $photos;
return $this;
}
}