. */ namespace SP\Domain\User; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\DataModel\ItemSearchData; use SP\DataModel\UserGroupData; use SP\Infrastructure\Common\Repositories\NoSuchItemException; use SP\Infrastructure\Database\QueryResult; /** * Class UserGroupService * * @package SP\Domain\Common\Services\UserGroup */ interface UserGroupServiceInterface { /** * @throws ConstraintException * @throws QueryException */ public function search(ItemSearchData $itemSearchData): QueryResult; /** * @throws ConstraintException * @throws QueryException * @throws NoSuchItemException */ public function getById(int $id): UserGroupData; /** * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException */ public function delete(int $id): UserGroupServiceInterface; /** * @param int[] $ids * * @throws \SP\Domain\Common\Services\ServiceException * @throws ConstraintException * @throws QueryException */ public function deleteByIdBatch(array $ids): int; /** * @throws \SP\Domain\Common\Services\ServiceException */ public function create(UserGroupData $itemData): int; /** * @throws \SP\Domain\Common\Services\ServiceException */ public function update(UserGroupData $itemData): void; /** * Get all items from the service's repository * * @return UserGroupData[] * @throws ConstraintException * @throws QueryException */ public function getAllBasic(): array; /** * Returns the item for given name * * @throws NoSuchItemException * @throws ConstraintException * @throws QueryException */ public function getByName(string $name): UserGroupData; /** * Returns the users that are using the given group id * * @throws ConstraintException * @throws QueryException */ public function getUsage(int $id): array; /** * Returns the items that are using the given group id * * @throws ConstraintException * @throws QueryException */ public function getUsageByUsers(int $id): array; }