function certificate_get_certificate_mapper_values in Certificate 4.x
Get mapper value options
File
- ./
certificate.module, line 171
Code
function certificate_get_certificate_mapper_values(BaseFieldDefinition $definition = NULL, ContentEntityInterface $entity = NULL) {
$options = [];
$certificate_mappers = Drupal::service('plugin.manager.certificate_mapper');
$mapper_definitions = $certificate_mappers
->getDefinitions();
foreach ($mapper_definitions as $map_type => $map) {
$plugin = $certificate_mappers
->createInstance($map_type, [
'of' => 'configuration values',
]);
// Skip plugins that are missing dependent modules
if (!$plugin
->hasDependencies()) {
continue;
}
$options += $plugin
->getMapKeys();
}
return $options;
}