YamlFormEntityOptionsTrait.php in YAML Form 8
File
src/Plugin/YamlFormElement/YamlFormEntityOptionsTrait.php
View source
<?php
namespace Drupal\yamlform\Plugin\YamlFormElement;
use Drupal\yamlform\YamlFormSubmissionInterface;
use Drupal\yamlform\Element\YamlFormEntityTrait;
trait YamlFormEntityOptionsTrait {
public function getDefaultProperties() {
$properties = parent::getDefaultProperties() + [
'target_type' => '',
'selection_handler' => '',
'selection_settings' => [],
];
unset($properties['options']);
return $properties;
}
public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
YamlFormEntityTrait::setOptions($element);
parent::prepare($element, $yamlform_submission);
}
protected function getElementSelectorInputsOptions(array $element) {
YamlFormEntityTrait::setOptions($element);
return parent::getElementSelectorInputsOptions($element);
}
}