src/External/LocationServer/Api/LocationServerClient.php
public function suggest($zipcode, $number, $addition = null)
    {
      // Concat url
      $url = self::API_URL . '/suggest?q=' . $zipcode . '-' . $number . (!empty($addition) ? '-' . $addition : '');

      // Create a REST request
      $request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_METHOD_GET);

      // Create a REST response
      $response = new \LibX\Net\Rest\Response();

      // Make the call
      $data = $this->call($request, $response);

      if($data->response->numFound > 1)
        throw new Exception('More then one document found');

      // Get document
      $document = array_pop($data->response->docs);

      // Check type
      if($document->type !== 'adres')
        throw new Exception('Invalid document type found (' . $doc->type . ')');

      // Get address id
      $id = $document->id;

      return $id;
    }
public function suggest($zipcode, $number, $addition = null)
    {
      // Concat url
      $url = self::API_URL . '/suggest?q=' . $zipcode . '-' . $number . (!empty($addition) ? '-' . $addition : '');

      // Create a REST request
      $request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_METHOD_GET);

      // Create a REST response
      $response = new \LibX\Net\Rest\Response();

      // Make the call
      $data = $this->call($request, $response);

      if($data->response->numFound > 1)
        throw new Exception('More then one document found');

      // Get document
      $document = array_pop($data->response->docs);

      // Check type
      if($document->type !== 'adres')
        throw new Exception('Invalid document type found (' . $doc->type . ')');

      // Get address id
      $id = $document->id;

      return $id;
    }
public function suggest ( $ zipcode , $ number , $ addition = null ) { // Concat url $ url = self :: API_URL . '/suggest?q=' . $ zipcode . '-' . $ number . ( ! empty ( $ addition ) ? '-' . $ addition : '' ) ; // Create a REST request $ request = new \ LibX \ Net \ Rest \ Request ( $ url , \ LibX \ Net \ Rest \ Request :: REQUEST_METHOD_GET ) ; // Create a REST response $ response = new \ LibX \ Net \ Rest \ Response ( ) ; // Make the call $ data = $ this -> call ( $ request , $ response ) ; if ( $ data -> response -> numFound > 1 ) throw new Exception ( 'More then one document found' ) ; // Get document $ document = array_pop ( $ data -> response -> docs ) ; // Check type if ( $ document -> type !== 'adres' ) throw new Exception ( 'Invalid document type found (' . $ doc -> type . ')' ) ; // Get address id $ id = $ document -> id ; return $ id ; }
Suggest an address id

@param string $zipcode
@param integer $number
@param string $addition
@return string
Suggest an address id