TIDE/backend/app/Post/PostRepository.php
Yisroel Baum f73e5a1af5
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.
2026-05-06 22:28:45 +03:00

36 lines
639 B
PHP

<?php
namespace App\Post;
use RuntimeException;
interface PostRepository
{
public function create(CreatePostDto $dto): Post;
public function find(int $id): ?Post;
/**
* @return Post[]
*/
public function findByUserId(int $userId): array;
/**
* @return Post[]
*/
public function findRecent(int $limit): array;
public function delete(int $id): void;
/**
* @throws RuntimeException
*/
public function update(Post $post): Post;
public function findByFeatureSlot(int $slot): ?Post;
/**
* @return Post[]
*/
public function findFeatured(): array;
}