public function UserAnalyticsPrivateMessage::getValue in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 8.3 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 8.4 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 8.5 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 8.6 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 8.7 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 8.8 modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 10.3.x modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 10.1.x modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
- 10.2.x modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php \Drupal\social_private_message\Plugin\UserExportPlugin\UserAnalyticsPrivateMessage::getValue()
Returns the value.
Parameters
\Drupal\user\UserInterface $entity: The User entity to get the value from.
Return value
string The value.
Overrides UserExportPluginBase::getValue
File
- modules/
social_features/ social_private_message/ src/ Plugin/ UserExportPlugin/ UserAnalyticsPrivateMessage.php, line 30
Class
- UserAnalyticsPrivateMessage
- Provides a 'UserAnalyticsPrivateMessage' user export row.
Namespace
Drupal\social_private_message\Plugin\UserExportPluginCode
public function getValue(UserInterface $entity) {
$value = '';
/** @var \Drupal\private_message\Entity\PrivateMessage $storage */
try {
$storage = $this->entityTypeManager
->getStorage('private_message');
if ($storage instanceof ContentEntityStorageInterface) {
$value = (int) $storage
->getQuery()
->condition('owner', $entity
->id())
->count()
->execute();
}
} catch (\Exception $e) {
}
return $value;
}