taktik-laravel-pohovor/app/Services/Post/PostServiceInterface.php
2025-01-23 00:45:59 +01:00

34 lines
782 B
PHP

<?php
declare(strict_types=1);
namespace App\Services\Post;
use App\Models\Post;
use App\Services\PaginableResource;
use App\Services\QueryRequestModifiers\Post\PostFilterDTO;
use App\Services\QueryRequestModifiers\Post\PostOrderDTO;
interface PostServiceInterface
{
/**
* @return PaginableResource<Post>
*/
public function fetchPosts(int $page, ?PostFilterDTO $filters, ?PostOrderDTO $orderDef): PaginableResource;
public function findPost(int $id): ?Post;
/**
* @param array<string, mixed> $data
* @return Post
*/
public function storePost(array $data): Post;
/**
* @param array<string, mixed> $data
*/
public function updatePost(array $data, int $id): ?Post;
public function deletePost(int $id): bool;
}