. */ namespace SP\Domain\Account\Ports; use SP\Domain\Account\Models\File; use SP\Domain\Common\Ports\Repository; use SP\Domain\Core\Dtos\ItemSearchDto; use SP\Domain\Core\Exceptions\ConstraintException; use SP\Domain\Core\Exceptions\QueryException; use SP\Infrastructure\Database\QueryResult; /** * Class AccountFileRepository * * @package SP\Infrastructure\Account\Repositories */ interface AccountFileRepository extends Repository { /** * Creates an item * * @param File $fileData * * @return int * @throws ConstraintException * @throws QueryException */ public function create(File $fileData): int; /** * Returns the item for given id * * @param int $id * * @return QueryResult * @throws ConstraintException * @throws QueryException */ public function getByAccountId(int $id): QueryResult; /** * Deletes an item * * @param int $id * * @return bool * @throws ConstraintException * @throws QueryException */ public function delete(int $id): bool; /** * Returns the item for given id * * @param int $id * * @return QueryResult */ public function getById(int $id): QueryResult; /** * Deletes all the items for given ids * * @param array $ids * * @return int * @throws ConstraintException * @throws QueryException */ public function deleteByIdBatch(array $ids): int; /** * Searches for items by a given filter * * @param ItemSearchDto $itemSearchData * * @return QueryResult */ public function search(ItemSearchDto $itemSearchData): QueryResult; }