Fetches results from the Business Search API by Phone.

@param    array    $parameters

@return   stdClass
@throws   Stevenmaguire\Yelp\Exception\HttpException
347223
public function searchByPhone($parameters = [])
    {
        $path = $this->appendParametersToUrl('/v2/phone_search', $parameters);
        $request = $this->getRequest('GET', $path);

        return $this->processRequest($request);
    }
1014236
public function find(array $parameters = [], array $headers = [])
    {
        $resolver = new OptionsResolver();

        $resolver->setDefined('subscription_id')
            ->setAllowedTypes('subscription_id', 'string')
            ->setRequired('subscription_id');

        $resolver->setDefined('label')
            ->setAllowedTypes('label', 'string')
            ->setRequired('label');

        $url = $this->url('addresses');

        return $this->get($url, $resolver->resolve($parameters), $headers);
    }
1090709
public function search($parameters)
    {
        $this->result = null;
        $result = $this->request('POST', $this->getCore().'/select', [], $parameters, 'form_params');
        $this->result = new SolrSearchResult($result, $this);

        return $this->result;
    }
857296
public function get($url, $parameters = [])
    {
        $query = $this->buildQuery($url, $parameters);
        $url = static::LOCATION.$url.(strpos($url, '?') !== false ? '&' : '?').$query;
        $headers = $this->buildHeaders();

        $request = $this->requestProvider->createRequest('GET', $url, $headers);
        $response = $this->client->send($request);

        // Throw any errors we have before continuing
        $this->errorCheckResponse($response);

        return json_decode($this->streamToString($response->getBody()));
    }
538428
public function handle(...$parameters)
    {
        abort_if(! $this->checkAccess(), 403);

        if ($this->request->method() === 'GET' || (! count($parameters))) {
            $this->arguments = $parameters;

            return $this->view();
        }

        $method = array_pop($parameters);
        $this->arguments = $parameters;

        if (Str::startsWith($method, 'async')) {
            return $this->asyncBuild($method, array_pop($this->arguments));
        }

        $this->reflectionParams($method);

        return call_user_func_array([$this, $method], $this->arguments);
    }
34623
public function getBusinessesSearchResultsByPhone($phoneNumber)
    {
        $parameters = [
            'phone' => $phoneNumber
        ];

        $path = $this->appendParametersToUrl('/v3/businesses/search/phone', $parameters);
        $request = $this->getRequest('GET', $path, $this->getDefaultHeaders());

        return $this->processRequest($request);
    }
414679
public static function listAllOptionsAsync(array $parameters = [])
    {
        return self::listAllOptionsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
740259
protected function getObjectsRawData(array $parameters = array())
    {
        $cacheKey = md5(json_encode(array($this->getName(), $parameters)));

        if (!array_key_exists($cacheKey, self::$listObjectsCache)) {
            $tmp = array();

            foreach ($parameters as $k => $v) {
                if (in_array($k, self::$allowedParameters)) {
                    $tmp[$k] = $v;
                }
            }

            $response = $this->connection->makeRequest(Client::GET, array($this->name), array(), $tmp);
            self::$listObjectsCache[$cacheKey] = $response['body'];
        }

        return self::$listObjectsCache[$cacheKey];
    }
1271239
public function getItems($parameters)
    {
        $parameters['action'] = 'get_items';

        $response = $this->sendRequest($parameters);

        // check and reorganize the data of the SMA response
        $data = $response->getData();
        if (!isset($data['items']) || !is_array($data['items'])) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                '"items" is not set or not an array. Response: ' . var_export($data, true)
            );
        }

        $items = array();
        foreach ($data['items'] as $item) {
            $items[] = new ShopgateItem($item);
        }

        // put the reorganized data into the response object and return ist
        $response->setData($items);

        return $response;
    }
504513
public function get($paymentId, array $parameters = [])
    {
        if (empty($paymentId) || strpos($paymentId, self::RESOURCE_ID_PREFIX) !== 0) {
            throw new ApiException("Invalid payment ID: '{$paymentId}'. A payment ID should start with '".self::RESOURCE_ID_PREFIX."'.");
        }

        return parent::rest_read($paymentId, $parameters);
    }
307428
public static function listAllGatewaysAsync(array $parameters = [])
    {
        return self::listAllGatewaysAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
1336002
protected function getFilterCriteria(array $parameters)
    {
        /** @var \Netgen\EzPlatformSiteApi\API\Values\Location $location */
        $location = $parameters['location'];

        return [
            new ParentLocationId($location->parentLocationId),
            new LogicalNot(new LocationId($location->id)),
        ];
    }
415221
protected function doCall(array $parameters = array())
    {
        // check if curl is available
        if (!function_exists('curl_init')) {
            throw Exception::CurlNotInstalled();
        }

        // init curl
        $curl = curl_init();

        // set options
        curl_setopt($curl, CURLOPT_URL, $this->createUrl($parameters));
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
        if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) {
            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        }

        // execute
        $response = curl_exec($curl);

        // fetch errors
        $errorNumber = curl_errno($curl);
        $errorMessage = curl_error($curl);

        // close curl
        curl_close($curl);

        // we have errors
        if ($errorNumber != '') {
            throw new Exception($errorMessage);
        }

        // redefine response as json decoded
        $response = json_decode($response);

        // API returns with an error
        if (isset($response->error_message)) {
            throw new Exception($response->error_message);
        }

        // return the content
        return $response->results;
    }
329491
public function getBusinessesSearchResults($parameters = [])
    {
        $csvParams = ['attributes', 'categories', 'price'];

        $path = $this->appendParametersToUrl('/v3/businesses/search', $parameters, $csvParams);
        $request = $this->getRequest('GET', $path, $this->getDefaultHeaders());

        return $this->processRequest($request);
    }
792095
public static function listAllCustomersAsync(array $parameters = [])
    {
        return self::listAllCustomersAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
495344
public function list(array $parameters = [], array $headers = [])
    {
        $resolver = $this->createOptionsResolver();

        $resolver->setDefined('include_deleted')
            ->setAllowedTypes('include_deleted', 'boolean');

        $resolver->setDefined('sort_by')
            ->setAllowedTypes('sort_by', 'string');

        $url = $this->url('invoices');

        return $this->get($url, $resolver->resolve($parameters), $headers);
    }
950215
public function getParameters(array $parameters = [])
    {
        foreach (['view', 'this'] as $forbiddenKey) {
            if (array_key_exists($forbiddenKey, $parameters)) {
                throw new \ErrorException('The "' . $forbiddenKey . '" key is forbidden.');
            }
        }
        $sharedVariables = $this->getOptionDefault('shared_variables');
        if ($sharedVariables) {
            $parameters = array_merge($sharedVariables, $parameters);
        }
        $parameters['view'] = $this;

        return $parameters;
    }