1
|
|
|
<?php namespace Geocoder\Laravel; |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the GeocoderLaravel library. |
5
|
|
|
* For the full copyright and license information, please view the LICENSE |
6
|
|
|
* file that was distributed with this source code. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
use Geocoder\ProviderAggregator; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @author Mike Bronner <[email protected]> |
13
|
|
|
*/ |
14
|
|
|
class GeocoderProviderAggregatorAdapter |
15
|
|
|
{ |
16
|
|
|
protected $aggregator; |
17
|
|
|
|
18
|
|
|
public function __construct(int $limit = Geocoder::DEFAULT_RESULT_LIMIT) |
19
|
|
|
{ |
20
|
|
|
$this->aggregator = new ProviderAggregator($limit); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function geocodeQuery($query) |
24
|
|
|
{ |
25
|
|
|
return $this->aggregator->geocodeQuery($query); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function reverseQuery($query) |
29
|
|
|
{ |
30
|
|
|
return $this->aggregator->reverseQuery($query); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function getName() |
34
|
|
|
{ |
35
|
|
|
return $this->aggregator->getName(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function geocode($value) |
39
|
|
|
{ |
40
|
|
|
return $this->aggregator->geocode($value); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function reverse(float $latitude, float $longitude) |
44
|
|
|
{ |
45
|
|
|
return $this->aggregator->reverse($latitude, $longitude); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function limit($limit) |
49
|
|
|
{ |
50
|
|
|
$this->aggregator->limit($limit); |
51
|
|
|
|
52
|
|
|
return $this; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getLimit() |
56
|
|
|
{ |
57
|
|
|
return $this->aggregator->getLimit(); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function registerProvider($provider) |
61
|
|
|
{ |
62
|
|
|
$this->aggregator->registerProvider($provider); |
63
|
|
|
|
64
|
|
|
return $this; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function registerProviders($providers = []) |
68
|
|
|
{ |
69
|
|
|
$this->aggregator->registerProviders($providers); |
70
|
|
|
|
71
|
|
|
return $this; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function using($name) |
75
|
|
|
{ |
76
|
|
|
$this->aggregator->using($name); |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function getProviders() |
82
|
|
|
{ |
83
|
|
|
return $this->aggregator->getProviders(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
protected function getProvider() |
87
|
|
|
{ |
88
|
|
|
return $this->aggregator->getProvider(); |
|
|
|
|
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.