<?php
namespace App\Entity\Sales;
use App\Repository\PlacementHidingRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Index;
#[ORM\Table(name: 'placement_hidings')]
#[Index(name: 'idx_entity_type', columns: ['entity_type'])]
#[Index(name: 'idx_profile_entity_type', columns: ['profile_id', 'entity_type'])]
#[Index(name: 'idx_saloon_entity_type', columns: ['saloon_id', 'entity_type'])]
#[ORM\Entity(repositoryClass: PlacementHidingRepository::class)]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'entity_type', type: 'string', length: 12)]
#[ORM\DiscriminatorMap(['profile' => Profile\PlacementHiding::class, 'saloon' => Saloon\PlacementHiding::class])]
abstract class PlacementHiding
{
#[ORM\Id]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected int $id;
/**
* Время добавление опции "спрятать"
*/
#[ORM\Column(name: 'placed_at', type: 'datetimetz_immutable')]
protected \DateTimeImmutable $placedAt;
/**
* Время следующего списания за скрытие в списке
*/
#[ORM\Column(name: 'placed_until', type: 'datetimetz_immutable')]
protected \DateTimeImmutable $placedUntil;
protected function __construct(\DateTimeImmutable $placedAt, \DateTimeImmutable $placedUntil)
{
$this->placedAt = $placedAt;
$this->placedUntil = $placedUntil;
}
public function getPlacedAt(): \DateTimeImmutable
{
return $this->placedAt;
}
public function getPlacedUntil(): \DateTimeImmutable
{
return $this->placedUntil;
}
public function prolong(\DateTimeImmutable $placedUntil): void
{
$this->placedUntil = $placedUntil;
}
}