public function BlazyEntityReferenceBase::getScopedFormElements in Blazy 8.2
Same name and namespace in other branches
- 8 src/Dejavu/BlazyEntityReferenceBase.php \Drupal\blazy\Dejavu\BlazyEntityReferenceBase::getScopedFormElements()
Defines the scope for the form elements.
Overrides BlazyEntityMediaBase::getScopedFormElements
1 call to BlazyEntityReferenceBase::getScopedFormElements()
- BlazyTestEntityReferenceFormatterTest::getScopedFormElements in tests/
modules/ blazy_test/ src/ Plugin/ Field/ FieldFormatter/ BlazyTestEntityReferenceFormatterTest.php - Defines the scope for the form elements.
1 method overrides BlazyEntityReferenceBase::getScopedFormElements()
- BlazyTestEntityReferenceFormatterTest::getScopedFormElements in tests/
modules/ blazy_test/ src/ Plugin/ Field/ FieldFormatter/ BlazyTestEntityReferenceFormatterTest.php - Defines the scope for the form elements.
File
- src/
Dejavu/ BlazyEntityReferenceBase.php, line 116
Class
- BlazyEntityReferenceBase
- Base class for all entity reference formatters with field details.
Namespace
Drupal\blazy\DejavuCode
public function getScopedFormElements() {
$admin = $this
->admin();
$target_type = $this
->getFieldSetting('target_type');
$views_ui = $this
->getFieldSetting('handler') == 'default';
$bundles = $views_ui ? [] : $this
->getFieldSetting('handler_settings')['target_bundles'];
$strings = [
'text',
'string',
'list_string',
];
$strings = $admin
->getFieldOptions($bundles, $strings, $target_type);
$texts = [
'text',
'text_long',
'string',
'string_long',
'link',
];
$texts = $admin
->getFieldOptions($bundles, $texts, $target_type);
$links = [
'text',
'string',
'link',
];
return [
'classes' => $strings,
'images' => $admin
->getFieldOptions($bundles, [
'image',
], $target_type),
'layouts' => $strings,
'links' => $admin
->getFieldOptions($bundles, $links, $target_type),
'titles' => $texts,
'vanilla' => TRUE,
] + parent::getScopedFormElements();
}