public function CivicrmOptions::getRelatedTypes in Webform CiviCRM Integration 8.5
Get related element types.
Parameters
array $element: The element.
Return value
array An array containing related element types.
Overrides OptionsBase::getRelatedTypes
File
- src/
Plugin/ WebformElement/ CivicrmOptions.php, line 252
Class
- CivicrmOptions
- Provides a 'civicrm_options' element.
Namespace
Drupal\webform_civicrm\Plugin\WebformElementCode
public function getRelatedTypes(array $element) {
$types = [];
$has_multiple_values = $this
->hasMultipleValues($element);
$supportedTypes = [
'checkboxes',
'radios',
'select',
];
$elements = $this->elementManager
->getInstances();
foreach ($elements as $element_name => $element_instance) {
if (!in_array($element_name, $supportedTypes)) {
continue;
}
if ($has_multiple_values !== $element_instance
->hasMultipleValues($element)) {
continue;
}
$types[$element_name] = $element_instance
->getPluginLabel();
}
asort($types);
return $types;
}