public function Query($query, $startPosition = null, $maxResults = null)
    {
        $this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method Query.");

        if ('QBO' == $this->serviceContext->serviceType) {
            $httpsContentType = CoreConstants::CONTENTTYPE_APPLICATIONTEXT;
        } else {
            $httpsContentType = CoreConstants::CONTENTTYPE_TEXTPLAIN;
        }

        $httpsUri = implode(CoreConstants::SLASH_CHAR, array('company', $this->serviceContext->realmId, 'query'));
        $httpsPostBody = $this->appendPaginationInfo($query, $startPosition, $maxResults);

        $requestParameters = $this->getPostRequestParameters($httpsUri, $httpsContentType);
        $restRequestHandler = $this->getRestHandler();
        list($responseCode, $responseBody) = $restRequestHandler->sendRequest($requestParameters, $httpsPostBody, null, $this->isThrownExceptionOnError());
        $faultHandler = $restRequestHandler->getFaultHandler();
        if ($faultHandler) {
            $this->lastError = $faultHandler;
            return null;
        } else {
            $this->lastError = false;
            $parsedResponseBody = null;
            try {
                $responseXmlObj = simplexml_load_string($responseBody);
                if ($responseXmlObj && $responseXmlObj->QueryResponse) {
                    $tmpXML = $responseXmlObj->QueryResponse->asXML();
                }
                $parsedResponseBody = $this->responseSerializer->Deserialize($tmpXML, false);
                $this->serviceContext->IppConfiguration->Logger->CustomLogger->Log(TraceLevel::Info, $parsedResponseBody);

            } catch (\Exception $e) {
                throw new \Exception("Exception appears in converting Response to XML.");
            }

            return $parsedResponseBody;
        }
    }
public function Query($query, $startPosition = null, $maxResults = null)
    {
        $this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method Query.");

        if ('QBO' == $this->serviceContext->serviceType) {
            $httpsContentType = CoreConstants::CONTENTTYPE_APPLICATIONTEXT;
        } else {
            $httpsContentType = CoreConstants::CONTENTTYPE_TEXTPLAIN;
        }

        $httpsUri = implode(CoreConstants::SLASH_CHAR, array('company', $this->serviceContext->realmId, 'query'));
        $httpsPostBody = $this->appendPaginationInfo($query, $startPosition, $maxResults);

        $requestParameters = $this->getPostRequestParameters($httpsUri, $httpsContentType);
        $restRequestHandler = $this->getRestHandler();
        list($responseCode, $responseBody) = $restRequestHandler->sendRequest($requestParameters, $httpsPostBody, null, $this->isThrownExceptionOnError());
        $faultHandler = $restRequestHandler->getFaultHandler();
        if ($faultHandler) {
            $this->lastError = $faultHandler;
            return null;
        } else {
            $this->lastError = false;
            $parsedResponseBody = null;
            try {
                $responseXmlObj = simplexml_load_string($responseBody);
                if ($responseXmlObj && $responseXmlObj->QueryResponse) {
                    $tmpXML = $responseXmlObj->QueryResponse->asXML();
                }
                $parsedResponseBody = $this->responseSerializer->Deserialize($tmpXML, false);
                $this->serviceContext->IppConfiguration->Logger->CustomLogger->Log(TraceLevel::Info, $parsedResponseBody);

            } catch (\Exception $e) {
                throw new \Exception("Exception appears in converting Response to XML.");
            }

            return $parsedResponseBody;
        }
    }
public function Query ( $ query , $ startPosition = null , $ maxResults = null ) { $ this -> serviceContext -> IppConfiguration -> Logger -> RequestLog -> Log ( TraceLevel :: Info , "Called Method Query." ) ; if ( 'QBO' == $ this -> serviceContext -> serviceType ) { $ httpsContentType = CoreConstants :: CONTENTTYPE_APPLICATIONTEXT ; } else { $ httpsContentType = CoreConstants :: CONTENTTYPE_TEXTPLAIN ; } $ httpsUri = implode ( CoreConstants :: SLASH_CHAR , array ( 'company' , $ this -> serviceContext -> realmId , 'query' ) ) ; $ httpsPostBody = $ this -> appendPaginationInfo ( $ query , $ startPosition , $ maxResults ) ; $ requestParameters = $ this -> getPostRequestParameters ( $ httpsUri , $ httpsContentType ) ; $ restRequestHandler = $ this -> getRestHandler ( ) ; list ( $ responseCode , $ responseBody ) = $ restRequestHandler -> sendRequest ( $ requestParameters , $ httpsPostBody , null , $ this -> isThrownExceptionOnError ( ) ) ; $ faultHandler = $ restRequestHandler -> getFaultHandler ( ) ; if ( $ faultHandler ) { $ this -> lastError = $ faultHandler ; return null ; } else { $ this -> lastError = false ; $ parsedResponseBody = null ; try { $ responseXmlObj = simplexml_load_string ( $ responseBody ) ; if ( $ responseXmlObj && $ responseXmlObj -> QueryResponse ) { $ tmpXML = $ responseXmlObj -> QueryResponse -> asXML ( ) ; } $ parsedResponseBody = $ this -> responseSerializer -> Deserialize ( $ tmpXML , false ) ; $ this -> serviceContext -> IppConfiguration -> Logger -> CustomLogger -> Log ( TraceLevel :: Info , $ parsedResponseBody ) ; } catch ( \ Exception $ e ) { throw new \ Exception ( "Exception appears in converting Response to XML." ) ; } return $ parsedResponseBody ; } }
Retrieves specified entities based passed page number and page size and query

@param string $query Query to issue
@param int $startPosition Starting page number
@param int $maxResults Page size
@return array Returns an array of entities fulfilling the query. If the response is Empty, it will return NULL
Retrieves specified entities based passed page number and page size and query