class OpenSocialVersion in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 8.5 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 8.6 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 8.7 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 8.8 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 10.3.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 10.1.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- 10.2.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
Provides a 'OpenSocialVersion' share usage data plugin.
Plugin annotation
@ShareUsageDataPlugin(
id = "open_social_version",
label = @Translation("Open Social version"),
setting = "open_social_version",
weight = -450,
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPluginBase implements ContainerFactoryPluginInterface, ShareUsageDataPluginInterface uses StringTranslationTrait
- class \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion
- class \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPluginBase implements ContainerFactoryPluginInterface, ShareUsageDataPluginInterface uses StringTranslationTrait
Expanded class hierarchy of OpenSocialVersion
File
- modules/
custom/ social_lets_connect/ modules/ social_lets_connect_usage/ src/ Plugin/ ShareUsageDataPlugin/ OpenSocialVersion.php, line 17
Namespace
Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPluginView source
class OpenSocialVersion extends ShareUsageDataPluginBase {
/**
* Get the value.
*
* @return array
* $json array.
*/
public function getValue() {
$version = 0;
$profile = \Drupal::installProfile();
if ($profile === 'social') {
$info = \Drupal::service('extension.list.profile')
->getExtensionInfo($profile);
if (!empty($info['version'])) {
$version = $info['version'];
}
}
return [
'version' => $version,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OpenSocialVersion:: |
public | function |
Get the value. Overrides ShareUsageDataPluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
ShareUsageDataPluginBase:: |
public | property | The config. | |
ShareUsageDataPluginBase:: |
public | property | The entity type manager. | |
ShareUsageDataPluginBase:: |
public static | function |
The create method. Overrides ContainerFactoryPluginInterface:: |
|
ShareUsageDataPluginBase:: |
public | function |
Check if this plugin should be enabled. Overrides ShareUsageDataPluginInterface:: |
|
ShareUsageDataPluginBase:: |
public | function |
UserExportPluginBase constructor. Overrides PluginBase:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |