public function Entity::outputCallback in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.2 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.3 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.4 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.5 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.6 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.7 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 8.8 modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 10.0.x modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 10.1.x modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
- 10.2.x modules/custom/mentions/src/Plugin/Mentions/Entity.php \Drupal\mentions\Plugin\Mentions\Entity::outputCallback()
The outputCallback function.
Parameters
string $mention: The mention.
array|string $settings: The settings.
Return value
mixed Returns mixed.
Overrides MentionsPluginInterface::outputCallback
File
- modules/
custom/ mentions/ src/ Plugin/ Mentions/ Entity.php, line 53
Class
- Entity
- Class Entity.
Namespace
Drupal\mentions\Plugin\MentionsCode
public function outputCallback($mention, $settings) {
$entity = $this->entityTypeManager
->getStorage($mention['target']['entity_type'])
->load($mention['target']['entity_id']);
$output = [];
$output['value'] = $this->tokenService
->replace($settings['value'], [
$mention['target']['entity_type'] => $entity,
]);
if ($settings['renderlink']) {
$output['link'] = $this->tokenService
->replace($settings['rendertextbox'], [
$mention['target']['entity_type'] => $entity,
]);
}
return $output;
}