public function GeoLocation::__construct in GeoIP API 8.2
Constructs a new GeoLocation object.
Parameters
\Drupal\Component\Plugin\PluginManagerInterface $geolocators_manager: The geolocation locator plugin manager service to use.
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.
\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.
File
- src/
GeoLocation.php, line 47
Class
- GeoLocation
- Service to interact with the default geolocator plugin for geolocation.
Namespace
Drupal\geoipCode
public function __construct(PluginManagerInterface $geolocators_manager, ConfigFactoryInterface $config_factory, CacheBackendInterface $cache_backend) {
$this->geoLocatorManager = $geolocators_manager;
$this->configFactory = $config_factory;
$this->cacheBackend = $cache_backend;
$this->config = $this->configFactory
->get('geoip.geolocation');
}