YamlFormExcludedColumns.php in YAML Form 8
File
src/Element/YamlFormExcludedColumns.php
View source
<?php
namespace Drupal\yamlform\Element;
class YamlFormExcludedColumns extends YamlFormExcludedBase {
public static function getYamlFormExcludedHeader() {
return [
t('Title'),
t('Name'),
t('Date type/Element type'),
];
}
public static function getYamlFormExcludedOptions(array $element) {
$options = [];
$submission_storage = \Drupal::entityTypeManager()
->getStorage('yamlform_submission');
$field_definitions = $submission_storage
->getFieldDefinitions();
foreach ($field_definitions as $key => $field_definition) {
$options[$key] = [
[
'title' => $field_definition['title'],
],
[
'name' => $key,
],
[
'type' => $field_definition['type'],
],
];
}
$options += parent::getYamlFormExcludedOptions($element);
return $options;
}
}