extend Post entity with feature slot

Adds nullable feature_slot column (unique) plus repo
findByFeatureSlot/findFeatured/update methods so admins can
pin a post into one of two slots.
This commit is contained in:
Yisroel Baum 2026-05-06 22:28:45 +03:00
parent 64a334c63e
commit f73e5a1af5
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
6 changed files with 160 additions and 4 deletions

View file

@ -12,6 +12,7 @@ class Post
private string $title,
private string $body,
private DateTimeImmutable $createdAt,
private ?int $featureSlot,
) {}
public function getId(): int
@ -38,4 +39,14 @@ class Post
{
return $this->createdAt;
}
public function getFeatureSlot(): ?int
{
return $this->featureSlot;
}
public function isFeatured(): bool
{
return $this->featureSlot !== null;
}
}