function DefaultSelection::defaultConfiguration
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::defaultConfiguration()
- 8.9.x core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::defaultConfiguration()
- 10 core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::defaultConfiguration()
Overrides SelectionPluginBase::defaultConfiguration
3 calls to DefaultSelection::defaultConfiguration()
- TermSelection::defaultConfiguration in core/
modules/ taxonomy/ src/ Plugin/ EntityReferenceSelection/ TermSelection.php - Gets default configuration for this plugin.
- UserSelection::defaultConfiguration in core/
modules/ user/ src/ Plugin/ EntityReferenceSelection/ UserSelection.php - Gets default configuration for this plugin.
- WorkspaceSelection::defaultConfiguration in core/
modules/ workspaces/ src/ Plugin/ EntityReferenceSelection/ WorkspaceSelection.php - Gets default configuration for this plugin.
3 methods override DefaultSelection::defaultConfiguration()
- TermSelection::defaultConfiguration in core/
modules/ taxonomy/ src/ Plugin/ EntityReferenceSelection/ TermSelection.php - Gets default configuration for this plugin.
- UserSelection::defaultConfiguration in core/
modules/ user/ src/ Plugin/ EntityReferenceSelection/ UserSelection.php - Gets default configuration for this plugin.
- WorkspaceSelection::defaultConfiguration in core/
modules/ workspaces/ src/ Plugin/ EntityReferenceSelection/ WorkspaceSelection.php - Gets default configuration for this plugin.
File
-
core/
lib/ Drupal/ Core/ Entity/ Plugin/ EntityReferenceSelection/ DefaultSelection.php, line 142
Class
- DefaultSelection
- Default plugin implementation of the Entity Reference Selection plugin.
Namespace
Drupal\Core\Entity\Plugin\EntityReferenceSelectionCode
public function defaultConfiguration() {
return [
// For the 'target_bundles' setting, a NULL value is equivalent to "allow
// entities from any bundle to be referenced" and an empty array value is
// equivalent to "no entities from any bundle can be referenced". The
// reason for NULL and an empty array having a different meaning is to
// correctly handle config updates.
// For example, in the scenario where a single target bundle is allowed,
// and that bundle is then deleted, the automatic removal of that bundle
// from the entity reference field's settings leaves an empty array.
// This empty array must therefore indicate that no bundles are allowed,
// as otherwise the field would suddenly allow all bundles.
'target_bundles' => NULL,
'sort' => [
'field' => '_none',
'direction' => 'ASC',
],
'auto_create' => FALSE,
'auto_create_bundle' => NULL,
] + parent::defaultConfiguration();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.