You are here

public function EntityRestrictedField::getFieldStorageBaseDefinition in Organic groups 8

Get the field storage config base definition.

Parameters

array $values: Values to override the base definitions.

Return value

array Array that will be used as the base values for FieldStorageConfig::create().

Overrides OgFieldBase::getFieldStorageBaseDefinition

File

tests/modules/og_test/src/Plugin/OgFields/EntityRestrictedField.php, line 24

Class

EntityRestrictedField
A test field that can be attached only to the node entity.

Namespace

Drupal\og_test\Plugin\OgFields

Code

public function getFieldStorageBaseDefinition(array $values = []) {
  $values = [
    // Restrict the allowed entities.
    'entity' => [
      'node',
    ],
    'type' => 'list_integer',
  ];
  return parent::getFieldStorageBaseDefinition($values);
}