. */ namespace SP\Domain\User\Ports; use SP\Domain\Core\Exceptions\ConstraintException; use SP\Domain\Core\Exceptions\QueryException; /** * Class UserToUserGroupService * * @package SP\Domain\Common\Services\UserGroup */ interface UserToUserGroupService { /** * @throws ConstraintException * @throws QueryException */ public function add(int $id, array $users): int; /** * @throws ConstraintException * @throws QueryException */ public function update(int $id, array $users): int; /** * @throws ConstraintException * @throws QueryException */ public function getUsersByGroupId(int $id): array; /** * Returns the groups which the user belongs to * * @throws ConstraintException * @throws QueryException */ public function getGroupsForUser(int $userId): array; }