public function FindAll($entityName, $pageNumber = 0, $pageSize = 500)
    {
        $this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method FindAll.");

        $phpClassName = DataService::decorateIntuitEntityToPhpClassName($entityName);

        // Handle some special cases
        if (strtolower('company') == strtolower($entityName)) {
            $entityName = 'CompanyInfo';
        }

        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 = "select * from $entityName startPosition $pageNumber maxResults $pageSize";

        $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) {
                    $parsedResponseBody = $this->responseSerializer->Deserialize($responseXmlObj->QueryResponse->asXML(), false);
                }
            } catch (\Exception $e) {
                throw new \Exception("Exception appears in converting Response to XML.");
            }

            return $parsedResponseBody;
        }
    }
public function FindAll($entityName, $pageNumber = 0, $pageSize = 500)
    {
        $this->serviceContext->IppConfiguration->Logger->RequestLog->Log(TraceLevel::Info, "Called Method FindAll.");

        $phpClassName = DataService::decorateIntuitEntityToPhpClassName($entityName);

        // Handle some special cases
        if (strtolower('company') == strtolower($entityName)) {
            $entityName = 'CompanyInfo';
        }

        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 = "select * from $entityName startPosition $pageNumber maxResults $pageSize";

        $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) {
                    $parsedResponseBody = $this->responseSerializer->Deserialize($responseXmlObj->QueryResponse->asXML(), false);
                }
            } catch (\Exception $e) {
                throw new \Exception("Exception appears in converting Response to XML.");
            }

            return $parsedResponseBody;
        }
    }
public function FindAll ( $ entityName , $ pageNumber = 0 , $ pageSize = 500 ) { $ this -> serviceContext -> IppConfiguration -> Logger -> RequestLog -> Log ( TraceLevel :: Info , "Called Method FindAll." ) ; $ phpClassName = DataService :: decorateIntuitEntityToPhpClassName ( $ entityName ) ; // Handle some special cases if ( strtolower ( 'company' ) == strtolower ( $ entityName ) ) { $ entityName = 'CompanyInfo' ; } 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 = "select * from $entityName startPosition $pageNumber maxResults $pageSize" ; $ 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 ) { $ parsedResponseBody = $ this -> responseSerializer -> Deserialize ( $ responseXmlObj -> QueryResponse -> asXML ( ) , false ) ; } } catch ( \ Exception $ e ) { throw new \ Exception ( "Exception appears in converting Response to XML." ) ; } return $ parsedResponseBody ; } }
Retrieves all entities by name

@param string $entityName
@param int $pageNumber
@param int $pageSize
@return array Returns an array of entities of specified type.
Retrieves all entities by name