Geocoder\Provider\Nominatim::__construct PHP Метод

__construct() публичный Метод

public __construct ( Http\Client\HttpClient $client, string $rootUrl, string $locale = null )
$client Http\Client\HttpClient An HTTP adapter.
$rootUrl string Root URL of the nominatim server
$locale string A locale (optional).
    public function __construct(HttpClient $client, $rootUrl, $locale = null)
    {
        parent::__construct($client);
        $this->rootUrl = rtrim($rootUrl, '/');
        $this->locale = $locale;
    }

Usage Example

Пример #1
0
 /**
  * @param HttpAdapterInterface $adapter An HTTP adapter.
  * @param string               $locale  A locale (optional).
  */
 public function __construct(HttpAdapterInterface $adapter, $kbid = null, $secretKey = null, $endpoint = null)
 {
     parent::__construct($adapter, static::ROOT_URL, 'it_IT');
     if (is_null($kbid)) {
         $kbid = 'demo';
     }
     if (is_null($secretKey)) {
         $secretKey = 'demo';
     }
     if (is_null($endpoint)) {
         $endpoint = "https://hub1.linkeddata.center/{$kbid}";
     }
     HttpClient::useIdentity($kbid, $secretKey);
     $this->sparql = new SparqlClient("{$endpoint}/sparql");
     $this->factory = new AddressFactory();
 }
All Usage Examples Of Geocoder\Provider\Nominatim::__construct