src/Jaspersoft/Service/UserService.php
public function searchUsers($searchTerm = null, $organization = null,
                                $requiredRoles = null, $hasAllRequiredRoles = null, $includeSubOrgs = true, $limit = 0, $offset = 0)
    {
        $result = array();
        $url = self::makeUserUrl($organization, null,
            array('q' => $searchTerm,
                  'requiredRole' => $requiredRoles,
                  'hasAllRequiredRoles' => $hasAllRequiredRoles,
                  'includeSubOrgs' => $includeSubOrgs,
                  'limit' => $limit,
                  'offset' => $offset));
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true, 'application/json', 'application/json');
        if (!empty($data)) {
            $users = json_decode($data);
            foreach ($users->user as $user) {
                $result[] = @new UserLookup(
                    $user->username,
                    $user->fullName,
                    $user->externallyDefined,
                    $user->tenantId
                );
            }
        }
        return $result;
    }
public function searchUsers($searchTerm = null, $organization = null,
                                $requiredRoles = null, $hasAllRequiredRoles = null, $includeSubOrgs = true, $limit = 0, $offset = 0)
    {
        $result = array();
        $url = self::makeUserUrl($organization, null,
            array('q' => $searchTerm,
                  'requiredRole' => $requiredRoles,
                  'hasAllRequiredRoles' => $hasAllRequiredRoles,
                  'includeSubOrgs' => $includeSubOrgs,
                  'limit' => $limit,
                  'offset' => $offset));
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true, 'application/json', 'application/json');
        if (!empty($data)) {
            $users = json_decode($data);
            foreach ($users->user as $user) {
                $result[] = @new UserLookup(
                    $user->username,
                    $user->fullName,
                    $user->externallyDefined,
                    $user->tenantId
                );
            }
        }
        return $result;
    }
public function searchUsers ( $ searchTerm = null , $ organization = null , $ requiredRoles = null , $ hasAllRequiredRoles = null , $ includeSubOrgs = true , $ limit = 0 , $ offset = 0 ) { $ result = array ( ) ; $ url = self :: makeUserUrl ( $ organization , null , array ( 'q' => $ searchTerm , 'requiredRole' => $ requiredRoles , 'hasAllRequiredRoles' => $ hasAllRequiredRoles , 'includeSubOrgs' => $ includeSubOrgs , 'limit' => $ limit , 'offset' => $ offset ) ) ; $ data = $ this -> service -> prepAndSend ( $ url , array ( 200 , 204 ) , 'GET' , null , true , 'application/json' , 'application/json' ) ; if ( ! empty ( $ data ) ) { $ users = json_decode ( $ data ) ; foreach ( $ users -> user as $ user ) { $ result [ ] = @ new UserLookup ( $ user -> username , $ user -> fullName , $ user -> externallyDefined , $ user -> tenantId ) ; } } return $ result ; }
Search for users based on the searchTerm provided.

An array of zero or more UserLookup objects will be returned. These can then be passed one by one to
the getUserByLookup function to return the User Object of the user.

If defining requiredRoles that exist in multiple organizations, you must suffix the ROLE name with
|organization_id (i.e: ROLE_USER|organization_1)

@param string $searchTerm A query to filter results by
@param string $organization
@param array $requiredRoles
@param boolean $hasAllRequiredRoles
@param boolean $includeSubOrgs
@param int $limit A number to limit results by (pagination controls)
@param int $offset A number to offset the results by (pagination controls)
@return array
Search for users based on the searchTerm provided .