class GeocoderPlugin in Geocoder 7.2
Same name in this branch
- 7.2 src/Annotation/GeocoderPlugin.php \Drupal\geocoder\Annotation\GeocoderPlugin
- 7.2 src/Plugin/GeocoderPlugin.php \Drupal\geocoder\Plugin\GeocoderPlugin
Hierarchy
- class \Drupal\geocoder\Plugin\GeocoderPlugin extends \Drupal\Component\Plugin\PluginBase implements GeocoderPluginInterface
Expanded class hierarchy of GeocoderPlugin
2 files declare their use of GeocoderPlugin
- Dumper.php in src/
Plugin/ Geocoder/ Dumper.php - Contains \Drupal\geocoder\Plugin\Geocoder\Dumper.
- Provider.php in src/
Plugin/ Geocoder/ Provider.php - Contains \Drupal\geocoder\Plugin\Geocoder\Provider.
File
- src/
Plugin/ GeocoderPlugin.php, line 13 - Contains \Drupal\geocoder\Plugin\GeocoderPlugin.
Namespace
Drupal\geocoder\PluginView source
class GeocoderPlugin extends PluginBase implements GeocoderPluginInterface {
/**
* GeocoderPlugin constructor.
*
* @param array $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
*/
public function __construct($configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->init();
}
/**
* {@inheritdoc}
*/
public function init() {
return $this;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration = array()) {
if (!empty($configuration)) {
$this->configuration = $configuration;
}
return $this;
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function cache_get($cid) {
if ((bool) Config::get('geocoder.cache', TRUE)) {
if ($cache = cache_get($cid, 'cache_geocoder')) {
return $cache->data;
}
}
return FALSE;
}
/**
* {@inheritdoc}
*/
public function cache_set($cid, $data) {
if ((bool) Config::get('geocoder.cache', TRUE)) {
cache_set($cid, $data, 'cache_geocoder', CACHE_PERMANENT);
}
}
/**
* {@inheritdoc}
*/
public function getCacheCid() {
$args = func_get_args();
$args[] = $this
->getPluginId();
$args[] = $this
->getConfiguration();
return sha1(serialize(array_filter($args)));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GeocoderPlugin:: |
public | function |
Get a cache object based on the cache ID. Overrides GeocoderPluginInterface:: |
|
GeocoderPlugin:: |
public | function |
Stores data in the persistent cache. Overrides GeocoderPluginInterface:: |
|
GeocoderPlugin:: |
public | function |
Generates a cache ID based on the arguments. Overrides GeocoderPluginInterface:: |
|
GeocoderPlugin:: |
public | function |
Get the object's configuration. Overrides GeocoderPluginInterface:: |
|
GeocoderPlugin:: |
public | function |
Init method launched after object initialization. Overrides GeocoderPluginInterface:: |
18 |
GeocoderPlugin:: |
public | function |
Set the object's configuration. Overrides GeocoderPluginInterface:: |
|
GeocoderPlugin:: |
public | function | GeocoderPlugin constructor. | 1 |