GeolocationGeometryDataManager.php in Geolocation Field 8.3
File
modules/geolocation_geometry/modules/geolocation_geometry_data/src/GeolocationGeometryDataManager.php
View source
<?php
namespace Drupal\geolocation_geometry_data;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
class GeolocationGeometryDataManager extends DefaultPluginManager {
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/geolocation/GeolocationGeometryData', $namespaces, $module_handler, NULL, 'Drupal\\geolocation_geometry_data\\Annotation\\GeolocationGeometryData');
$this
->alterInfo('geolocation_geometry_data_info');
$this
->setCacheBackend($cache_backend, 'geolocation_geometry_data');
}
public function getGemeotryDataBatch($id) {
$definitions = $this
->getDefinitions();
if (empty($definitions[$id])) {
return FALSE;
}
try {
$instance = $this
->createInstance($id);
if ($instance) {
return $instance
->getBatch();
}
} catch (\Exception $e) {
return FALSE;
}
return FALSE;
}
public function executeGemeotryDataBatch(array $batch_settings) {
batch_set($batch_settings);
$batch =& batch_get();
$batch['progressive'] = FALSE;
if (PHP_SAPI === 'cli' && function_exists('drush_backend_batch_process')) {
return drush_backend_batch_process();
}
else {
return batch_process();
}
}
}