31 lines
946 B
PHP
31 lines
946 B
PHP
<?php
|
|
|
|
namespace MintyPHP\Repository\User;
|
|
|
|
interface BookmarkRepositoryInterface
|
|
{
|
|
/** @return list<array<string, mixed>> */
|
|
public function listByUser(int $userId): array;
|
|
|
|
public function nextBookmarkSortOrder(int $userId, ?int $groupId): int;
|
|
|
|
public function countByUser(int $userId): int;
|
|
|
|
/** @return array<string, mixed>|false */
|
|
public function findById(int $id, int $userId): array|false;
|
|
|
|
/** @return array<string, mixed>|false */
|
|
public function findByUserAndUrl(int $userId, string $url): array|false;
|
|
|
|
public function create(array $data): int|false;
|
|
|
|
public function update(int $id, int $userId, array $data): bool;
|
|
|
|
public function delete(int $id, int $userId): bool;
|
|
|
|
/** @param list<array{id: int, sort_order: int}> $idOrderPairs */
|
|
public function updateSortOrders(int $userId, array $idOrderPairs): bool;
|
|
|
|
public function clearGroupId(int $groupId, int $userId): bool;
|
|
}
|