. */ namespace SP\Domain\Account\Ports; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\DataModel\FileData; use SP\DataModel\ItemSearchData; use SP\Domain\Common\Ports\RepositoryInterface; use SP\Infrastructure\Database\QueryResult; /** * Class AccountFileRepository * * @package SP\Infrastructure\Account\Repositories */ interface AccountFileRepositoryInterface extends RepositoryInterface { /** * Creates an item * * @param FileData $fileData * * @return int * @throws ConstraintException * @throws QueryException */ public function create(FileData $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 \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\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 ItemSearchData $itemSearchData * * @return \SP\Infrastructure\Database\QueryResult */ public function search(ItemSearchData $itemSearchData): QueryResult; }