Goal-Calibration/app/Text/TextRepository.php
Yisroel Baum acdf703d80
scope text endpoints by ownership
TextRepository gains findByUser; JsonTextRepository and the
fake implement filtering by stored userId. TextController
splits the list endpoint into getMyTexts (own) and
getAllTexts (admin), and getText now requires the session
user, returning 403 to non-owners while admins bypass.
2026-05-02 21:42:51 +03:00

24 lines
387 B
PHP

<?php
namespace App\Text;
use App\Text\Text;
use App\Text\CreateTextDto;
use App\User\User;
interface TextRepository
{
public function create(CreateTextDto $dto): Text;
public function find(int $id): ?Text;
/**
* @return Text[]
*/
public function getAll(): array;
/**
* @return Text[]
*/
public function findByUser(User $user): array;
}