class FieldStorageDefinition in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/entity_test/src/FieldStorageDefinition.php \Drupal\entity_test\FieldStorageDefinition
- 9 core/modules/system/tests/modules/entity_test/src/FieldStorageDefinition.php \Drupal\entity_test\FieldStorageDefinition
A custom field storage definition class.
For convenience we extend from BaseFieldDefinition although this should not implement FieldDefinitionInterface.
@todo Provide and make use of a proper FieldStorageDefinition class instead: https://www.drupal.org/node/2280639.
Hierarchy
- class \Drupal\Core\TypedData\DataDefinition implements \Drupal\Core\TypedData\ArrayAccess, DataDefinitionInterface uses TypedDataTrait
- class \Drupal\Core\TypedData\ListDataDefinition implements ListDataDefinitionInterface
- class \Drupal\Core\Field\BaseFieldDefinition implements FieldDefinitionInterface, FieldStorageDefinitionInterface, RequiredFieldStorageDefinitionInterface uses UnchangingCacheableDependencyTrait, FieldInputValueNormalizerTrait
- class \Drupal\entity_test\FieldStorageDefinition
- class \Drupal\Core\Field\BaseFieldDefinition implements FieldDefinitionInterface, FieldStorageDefinitionInterface, RequiredFieldStorageDefinitionInterface uses UnchangingCacheableDependencyTrait, FieldInputValueNormalizerTrait
- class \Drupal\Core\TypedData\ListDataDefinition implements ListDataDefinitionInterface
Expanded class hierarchy of FieldStorageDefinition
4 files declare their use of FieldStorageDefinition
- EntityDefinitionTestTrait.php in core/
modules/ system/ tests/ src/ Functional/ Entity/ Traits/ EntityDefinitionTestTrait.php - EntityDefinitionUpdateTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityDefinitionUpdateTest.php - EntityTestBaseFieldDisplay.php in core/
modules/ system/ tests/ modules/ entity_test/ src/ Entity/ EntityTestBaseFieldDisplay.php - entity_schema_test.module in core/
modules/ system/ tests/ modules/ entity_schema_test/ entity_schema_test.module - Test module for the entity API providing a bundle field.
File
- core/
modules/ system/ tests/ modules/ entity_test/ src/ FieldStorageDefinition.php, line 16
Namespace
Drupal\entity_testView source
class FieldStorageDefinition extends BaseFieldDefinition {
/**
* {@inheritdoc}
*/
public function isBaseField() {
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BaseFieldDefinition:: |
protected | property | ||
BaseFieldDefinition:: |
protected | property | An array of field property definitions. | |
BaseFieldDefinition:: |
protected | property | The field schema. | |
BaseFieldDefinition:: |
protected | property | The field type. | |
BaseFieldDefinition:: |
public | function | Adds constraints for a given field item property. | |
BaseFieldDefinition:: |
public static | function |
Creates a new field definition. Overrides ListDataDefinition:: |
|
BaseFieldDefinition:: |
public static | function | Creates a new field definition based upon a field storage definition. | |
BaseFieldDefinition:: |
public static | function |
Creates a new list data definition for items of the given data type. Overrides ListDataDefinition:: |
|
BaseFieldDefinition:: |
public | function |
Returns the maximum number of items allowed for the field. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the field columns, as defined in the field schema. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Gets an object that can be saved in configuration. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the default value for the field in a newly created entity. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the default value callback for the field. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the default value literal for the field. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the default display options for the field. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the field storage definition. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function | Returns the initial value for the field. | |
BaseFieldDefinition:: |
public | function | Returns the name of the field that will be used for getting initial values. | |
BaseFieldDefinition:: |
public | function |
Returns the name of the main property, if any. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the machine name of the field. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Gets an options provider for the given field item property. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Gets the definition of a contained property. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Gets an array of property definitions of contained properties. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the names of the field's subproperties. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the name of the provider of this field. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the field schema. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the value of a given setting. Overrides DataDefinition:: |
|
BaseFieldDefinition:: |
public | function |
Returns the array of settings, as required by the used class. Overrides DataDefinition:: |
|
BaseFieldDefinition:: |
public | function |
Gets the bundle the field is attached to. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the ID of the entity type the field is attached to. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the field type. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns a unique identifier for the field. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns a unique identifier for the field storage. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns the storage behavior for this field. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns whether the field is deleted or not. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns whether the display for the field can be configured. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Determines whether the data value is internal. Overrides DataDefinition:: |
|
BaseFieldDefinition:: |
public | function |
Returns whether the field can contain multiple items. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns whether the field storage is revisionable. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns whether the field storage is required. Overrides RequiredFieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Returns whether the field is translatable. Overrides FieldDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function | Sets the maximum number of items allowed for the field. | |
BaseFieldDefinition:: |
public | function | Sets the storage behavior for this field. | |
BaseFieldDefinition:: |
public | function | ||
BaseFieldDefinition:: |
public | function | ||
BaseFieldDefinition:: |
public | function | Sets whether the field storage is deleted. | |
BaseFieldDefinition:: |
public | function | Sets whether the display for the field can be configured. | |
BaseFieldDefinition:: |
public | function | Sets the display options for the field in forms or rendered entities. | |
BaseFieldDefinition:: |
public | function | Sets an initial value for the field. | |
BaseFieldDefinition:: |
public | function | Sets a field that will be used for getting initial values. | |
BaseFieldDefinition:: |
public | function | Sets the field name. | |
BaseFieldDefinition:: |
public | function | Sets constraints for a given field item property. | |
BaseFieldDefinition:: |
public | function | Sets the name of the provider of this field. | |
BaseFieldDefinition:: |
public | function | Sets whether the field is revisionable. | |
BaseFieldDefinition:: |
public | function |
Sets a definition setting. Overrides DataDefinition:: |
|
BaseFieldDefinition:: |
public | function |
Note that the method does not unset existing settings not specified in the
incoming $settings array. Overrides DataDefinition:: |
|
BaseFieldDefinition:: |
public | function | Sets whether the field storage is required. | |
BaseFieldDefinition:: |
public | function | Sets the bundle this field is defined for. | |
BaseFieldDefinition:: |
public | function | Sets the ID of the type of the entity this field is attached to. | |
BaseFieldDefinition:: |
public | function |
Sets whether the field is translatable. Overrides FieldStorageDefinitionInterface:: |
|
BaseFieldDefinition:: |
public | function |
Magic method: Implements a deep clone. Overrides ListDataDefinition:: |
|
BaseFieldDefinition:: |
public | function |
Overrides DataDefinition:: |
|
DataDefinition:: |
protected | property | The array holding values for all definition keys. | |
DataDefinition:: |
public | function |
Adds a validation constraint. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Returns a validation constraint. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Returns an array of validation constraints. Overrides DataDefinitionInterface:: |
1 |
DataDefinition:: |
public | function |
Returns a human readable description. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Returns a human readable label. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Determines whether the data value is computed. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Returns whether the data is multi-valued, i.e. a list of data items. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Determines whether the data is read-only. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function |
Determines whether a data value is required. Overrides DataDefinitionInterface:: |
|
DataDefinition:: |
public | function | ||
DataDefinition:: |
public | function | ||
DataDefinition:: |
public | function | ||
DataDefinition:: |
public | function | ||
DataDefinition:: |
public | function | Sets the class used for creating the typed data object. | |
DataDefinition:: |
public | function | Sets whether the data is computed. | |
DataDefinition:: |
public | function | Sets an array of validation constraints. | |
DataDefinition:: |
public | function | Sets the human-readable description. | |
DataDefinition:: |
public | function | Sets the whether the data value should be internal. | |
DataDefinition:: |
public | function | Sets the human-readable label. | |
DataDefinition:: |
public | function | Sets whether the data is read-only. | |
DataDefinition:: |
public | function | Sets whether the data is required. | |
DataDefinition:: |
public | function | Returns all definition values as array. | |
FieldInputValueNormalizerTrait:: |
protected static | function | Ensure a field value is transformed into a format keyed by delta. | |
FieldStorageDefinition:: |
public | function |
Determines whether the field is a base field. Overrides BaseFieldDefinition:: |
|
FieldStorageDefinitionInterface:: |
constant | Value indicating a field accepts an unlimited number of values. | ||
ListDataDefinition:: |
protected | property | The data definition of a list item. | |
ListDataDefinition:: |
public static | function |
Creates a new data definition object. Overrides DataDefinition:: |
|
ListDataDefinition:: |
public | function |
Returns the class used for creating the typed data object. Overrides DataDefinition:: |
|
ListDataDefinition:: |
public | function |
Returns the data type of the data. Overrides DataDefinition:: |
|
ListDataDefinition:: |
public | function |
Gets the data definition of an item of the list. Overrides ListDataDefinitionInterface:: |
|
ListDataDefinition:: |
public | function |
Sets the data type. Overrides DataDefinition:: |
|
ListDataDefinition:: |
public | function | Sets the item definition. | |
ListDataDefinition:: |
public | function |
Constructs a new data definition object. Overrides DataDefinition:: |
|
TypedDataTrait:: |
protected | property | The typed data manager used for creating the data types. | |
TypedDataTrait:: |
public | function | Gets the typed data manager. | 1 |
TypedDataTrait:: |
public | function | Sets the typed data manager. | 1 |
UnchangingCacheableDependencyTrait:: |
public | function | ||
UnchangingCacheableDependencyTrait:: |
public | function | ||
UnchangingCacheableDependencyTrait:: |
public | function |