private function getResult($command, $args, $fixArgs = false, $returnRaw = false)
    {
        $cmd = $this->getCommand($command, $args);

        // Marketo expects parameter arrays in the format id=1&id=2, Guzzle formats them as id[0]=1&id[1]=2.
        // Use a quick regex to fix it where necessary.
        if ($fixArgs) {
            $cmd->prepare();

            $url = preg_replace('/id%5B([0-9]+)%5D/', 'id', $cmd->getRequest()->getUrl());
            $cmd->getRequest()->setUrl($url);
        }

        $cmd->prepare();

        if ($returnRaw) {
            return $cmd->getResponse()->getBody(true);
        }

        return $cmd->getResult();
    }
private function getResult($command, $args, $fixArgs = false, $returnRaw = false)
    {
        $cmd = $this->getCommand($command, $args);

        // Marketo expects parameter arrays in the format id=1&id=2, Guzzle formats them as id[0]=1&id[1]=2.
        // Use a quick regex to fix it where necessary.
        if ($fixArgs) {
            $cmd->prepare();

            $url = preg_replace('/id%5B([0-9]+)%5D/', 'id', $cmd->getRequest()->getUrl());
            $cmd->getRequest()->setUrl($url);
        }

        $cmd->prepare();

        if ($returnRaw) {
            return $cmd->getResponse()->getBody(true);
        }

        return $cmd->getResult();
    }
private function getResult ( $ command , $ args , $ fixArgs = false , $ returnRaw = false ) { $ cmd = $ this -> getCommand ( $ command , $ args ) ; // Marketo expects parameter arrays in the format id=1&id=2, Guzzle formats them as id[0]=1&id[1]=2. // Use a quick regex to fix it where necessary. if ( $ fixArgs ) { $ cmd -> prepare ( ) ; $ url = preg_replace ( '/id%5B([0-9]+)%5D/' , 'id' , $ cmd -> getRequest ( ) -> getUrl ( ) ) ; $ cmd -> getRequest ( ) -> setUrl ( $ url ) ; } $ cmd -> prepare ( ) ; if ( $ returnRaw ) { return $ cmd -> getResponse ( ) -> getBody ( true ) ; } return $ cmd -> getResult ( ) ; }
Internal helper method to actually perform command.

@param string $command
@param array  $args
@param bool   $fixArgs

@return Response
Internal helper method to actually perform command .