public function search($search_term, $page = null, $objects_per_page = null)
    {
        $this->clearError();

        if ( empty($search_term) ) {
            throw new \RuntimeException('Missing search term');
        }

        $response = $this->getClient()->get(
            $this->getURL('search'),
            [
                'term' => $search_term,
            ]
        );

        if ( $response->hasError() ) {
            $this->setError( $response->getError() );
        }

        $this->clearError();

        // Return array of resource objects if no $object_id was given.
        // Note: the resource object (this object) used to execute get() will be left empty in this case.
        $objects = [];
        foreach ( $response->getData() as $object_data ) {
            $object = $this->getClient()->resource( get_class($this) );
            $object->setRemoteData($object_data);
            $objects[] = $object;
        }

        return $objects;
    }
public function search($search_term, $page = null, $objects_per_page = null)
    {
        $this->clearError();

        if ( empty($search_term) ) {
            throw new \RuntimeException('Missing search term');
        }

        $response = $this->getClient()->get(
            $this->getURL('search'),
            [
                'term' => $search_term,
            ]
        );

        if ( $response->hasError() ) {
            $this->setError( $response->getError() );
        }

        $this->clearError();

        // Return array of resource objects if no $object_id was given.
        // Note: the resource object (this object) used to execute get() will be left empty in this case.
        $objects = [];
        foreach ( $response->getData() as $object_data ) {
            $object = $this->getClient()->resource( get_class($this) );
            $object->setRemoteData($object_data);
            $objects[] = $object;
        }

        return $objects;
    }
public function search ( $ search_term , $ page = null , $ objects_per_page = null ) { $ this -> clearError ( ) ; if ( empty ( $ search_term ) ) { throw new \ RuntimeException ( 'Missing search term' ) ; } $ response = $ this -> getClient ( ) -> get ( $ this -> getURL ( 'search' ) , [ 'term' => $ search_term , ] ) ; if ( $ response -> hasError ( ) ) { $ this -> setError ( $ response -> getError ( ) ) ; } $ this -> clearError ( ) ; // Return array of resource objects if no $object_id was given. // Note: the resource object (this object) used to execute get() will be left empty in this case. $ objects = [ ] ; foreach ( $ response -> getData ( ) as $ object_data ) { $ object = $ this -> getClient ( ) -> resource ( get_class ( $ this ) ) ; $ object -> setRemoteData ( $ object_data ) ; $ objects [ ] = $ object ; } return $ objects ; }
Fetches tags for given search term.
Pagination available.

@param string  $search_term          Search term.
@param integer $page                 Page of tags, optional, if given, $objects_per_page must also be given
@param integer $objects_per_page     Number of tags per page, optional, if given, $page must also be given

@return mixed                        Returns array of ZammadAPIClient\Resource\... objects
or this object on failure.
Fetches tags for given search term . Pagination available .