function EntityReferenceItem::defaultStorageSettings

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::defaultStorageSettings()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::defaultStorageSettings()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::defaultStorageSettings()

Overrides FieldItemBase::defaultStorageSettings

1 call to EntityReferenceItem::defaultStorageSettings()
FileItem::defaultStorageSettings in core/modules/file/src/Plugin/Field/FieldType/FileItem.php
Defines the storage-level settings for this plugin.
1 method overrides EntityReferenceItem::defaultStorageSettings()
FileItem::defaultStorageSettings in core/modules/file/src/Plugin/Field/FieldType/FileItem.php
Defines the storage-level settings for this plugin.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php, line 47

Class

EntityReferenceItem
Defines the 'entity_reference' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public static function defaultStorageSettings() {
    return [
        'target_type' => \Drupal::moduleHandler()->moduleExists('node') ? 'node' : 'user',
    ] + parent::defaultStorageSettings();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.