public function GeoLocatorManager::__construct in GeoIP API 8.2
Constructs a new \Drupal\geoip\GeoLocatorsManager object.
Parameters
\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.
\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.
Overrides DefaultPluginManager::__construct
File
- src/
GeoLocatorManager.php, line 40
Class
- GeoLocatorManager
- Plugin manager for geolocator plugins.
Namespace
Drupal\geoipCode
public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) {
$interface = 'Drupal\\geoip\\Plugin\\GeoLocator\\GeoLocatorInterface';
$annotation = 'Drupal\\geoip\\Annotation\\GeoLocator';
parent::__construct('Plugin/GeoLocator', $namespaces, $module_handler, $interface, $annotation);
$this
->alterInfo('geolocator');
$this
->setCacheBackend($cache_backend, 'geolocator_plugins', [
'geoip',
]);
}