You are here

public function OpenSocialVersion::getValue in Open Social 10.2.x

Same name and namespace in other branches
  1. 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::getValue()
  2. 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::getValue()
  3. 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::getValue()
  4. 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::getValue()
  5. 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::getValue()
  6. 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::getValue()
  7. 10.0.x modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin\OpenSocialVersion::getValue()
  8. 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::getValue()

Get the value.

Return value

array $json array.

Overrides ShareUsageDataPluginBase::getValue

File

modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php, line 25

Class

OpenSocialVersion
Provides a 'OpenSocialVersion' share usage data plugin.

Namespace

Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPlugin

Code

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,
  ];
}