public function setCallback($callback = '')
    {
        if (self::RESULT_JSON !== $this->getResultFormat()) {
            throw new \BadMethodCallException('Callback can only be set with RESULT_JSON');
        }

        $this->defaultOptions['callback'] = $callback;
    }
public function setCallback($callback = '')
    {
        if (self::RESULT_JSON !== $this->getResultFormat()) {
            throw new \BadMethodCallException('Callback can only be set with RESULT_JSON');
        }

        $this->defaultOptions['callback'] = $callback;
    }
public function setCallback ( $ callback = '' ) { if ( self :: RESULT_JSON !== $ this -> getResultFormat ( ) ) { throw new \ BadMethodCallException ( 'Callback can only be set with RESULT_JSON' ) ; } $ this -> defaultOptions [ 'callback' ] = $ callback ; }
Set a custom callback function you want to use
when returning search results.
This setting works only when result format is set to
RESULT_JSON

@param string $callback

@throws \BadMethodCallException
Set a custom callback function you want to use when returning search results . This setting works only when result format is set to RESULT_JSON