protected function WebformOptionsCustomListBuilder::buildUsedBy in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_options_custom/src/WebformOptionsCustomListBuilder.php \Drupal\webform_options_custom\WebformOptionsCustomListBuilder::buildUsedBy()
Build list of webforms that the webform custom options is used by.
Parameters
\Drupal\webform_options_custom\WebformOptionsCustomInterface $webform_options_custom: A webform options custom entity.
Return value
array Table data containing list of webforms that the webform custom options is used by.
1 call to WebformOptionsCustomListBuilder::buildUsedBy()
- WebformOptionsCustomListBuilder::buildRow in modules/
webform_options_custom/ src/ WebformOptionsCustomListBuilder.php - Builds a row for an entity in the entity listing.
File
- modules/
webform_options_custom/ src/ WebformOptionsCustomListBuilder.php, line 222
Class
- WebformOptionsCustomListBuilder
- Defines a class to build a listing of webform options custom entities.
Namespace
Drupal\webform_options_customCode
protected function buildUsedBy(WebformOptionsCustomInterface $webform_options_custom) {
$links = [];
$webforms = $this
->getStorage()
->getUsedByWebforms($webform_options_custom);
foreach ($webforms as $id => $title) {
$links[] = [
'#type' => 'link',
'#title' => $title,
'#url' => Url::fromRoute('entity.webform.canonical', [
'webform' => $id,
]),
'#suffix' => '</br>',
];
}
return [
'nowrap' => TRUE,
'data' => $links,
];
}