commit 1038ff24d2d82e4eb9b35b085c18a403d18169bc Author: fago Date: Fri Mar 28 14:04:05 2014 +0100 Renamed to storage field interface. diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index e842798..930b7ec 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -518,7 +518,7 @@ public function getStorageFieldDefinitions($entity_type_id) { * The entity type ID. Only entity types that implement * \Drupal\Core\Entity\ContentEntityInterface are supported * - * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[] + * @return \Drupal\Core\Field\StorageFieldDefinitionInterface[] * An array of storage field definitions, keyed by field name. */ protected function buildStorageFieldDefinitions($entity_type_id) { diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index cd251d1..e2e4be7 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -64,13 +64,13 @@ public function getFieldDefinitions($entity_type_id, $bundle); * fields equal the full base field definition (i.e. they implement * \Drupal\Core\Field\FieldDefinitionInterface), while the storage fields for * bundle fields may implement - * \Drupal\Core\Field\FieldStorageDefinitionInterface only. + * \Drupal\Core\Field\StorageFieldDefinitionInterface only. * * @param string $entity_type_id * The entity type ID. Only entity types that implement * \Drupal\Core\Entity\ContentEntityInterface are supported. * - * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[] + * @return \Drupal\Core\Field\StorageFieldDefinitionInterface[] * The array of storage field definitions for the entity type, keyed by * field name. * diff --git a/core/lib/Drupal/Core/Field/FieldDefinition.php b/core/lib/Drupal/Core/Field/FieldDefinition.php index 68e7518..732c93f 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinition.php +++ b/core/lib/Drupal/Core/Field/FieldDefinition.php @@ -76,12 +76,12 @@ public static function create($type) { * definition in places where a full field definition is required; e.g., with * widgets or formatters. * - * @param FieldStorageDefinitionInterface $definition + * @param StorageFieldDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ - public static function createFromFieldStorageDefinition(FieldStorageDefinitionInterface $definition) { + public static function createFromFieldStorageDefinition(StorageFieldDefinitionInterface $definition) { return static::create($definition->getType()) ->setCardinality($definition->getCardinality()) ->setConstraints($definition->getConstraints()) diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php index a828e25..977fce5 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php @@ -52,7 +52,7 @@ * based on that abstract definition, even though that abstract definition can * differ from the concrete definition of any particular node's body field. */ -interface FieldDefinitionInterface extends FieldStorageDefinitionInterface, ListDataDefinitionInterface { +interface FieldDefinitionInterface extends StorageFieldDefinitionInterface, ListDataDefinitionInterface { /** * Returns whether the display for the field can be configured. diff --git a/core/lib/Drupal/Core/Field/FieldItemInterface.php b/core/lib/Drupal/Core/Field/FieldItemInterface.php index d10790d..0a15232 100644 --- a/core/lib/Drupal/Core/Field/FieldItemInterface.php +++ b/core/lib/Drupal/Core/Field/FieldItemInterface.php @@ -32,7 +32,7 @@ * * @see \Drupal\Core\Field\FieldDefinition */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition); + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition); /** * Returns the name of the main property, if any. @@ -57,7 +57,7 @@ public static function mainPropertyName(); * * Computed fields having no schema should return an empty array. * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_definition + * @param \Drupal\Core\Field\StorageFieldDefinitionInterface $field_definition * The field definition. * * @return array @@ -81,7 +81,7 @@ public static function mainPropertyName(); * specify another field as related, only existing SQL tables, * such as {taxonomy_term_data}. */ - public static function schema(FieldStorageDefinitionInterface $field_definition); + public static function schema(StorageFieldDefinitionInterface $field_definition); /** * Gets the entity that field belongs to. diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php deleted file mode 100644 index 645ef55..0000000 --- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php +++ /dev/null @@ -1,288 +0,0 @@ -foo returns its data. - * - * @return string - * The field name. - */ - public function getName(); - - /** - * Returns the field type. - * - * @return string - * The field type, i.e. the id of a field type plugin. For example 'text'. - * - * @see \Drupal\Core\Field\FieldTypePluginManagerInterface - */ - public function getType(); - - /** - * Returns the field settings. - * - * Each field type defines the settings that are meaningful for that type. - * For example, a text field can define a 'max_length' setting, and an image - * field can define a 'alt_field_required' setting. - * - * @return array - * An array of key/value pairs. - */ - public function getSettings(); - - /** - * Returns the value of a given field setting. - * - * @param string $setting_name - * The setting name. - * - * @return mixed - * The setting value. - */ - public function getSetting($setting_name); - - /** - * Returns whether the field is translatable. - * - * @return bool - * TRUE if the field is translatable. - */ - public function isTranslatable(); - - /** - * Returns whether the field is revisionable. - * - * @return bool - * TRUE if the field is revisionable. - */ - public function isRevisionable(); - - /** - * Determines whether the field is queryable via QueryInterface. - * - * @return bool - * TRUE if the field is queryable. - */ - public function isQueryable(); - - /** - * Returns the human-readable label for the field. - * - * @return string - * The field label. - */ - public function getLabel(); - - /** - * Returns the human-readable description for the field. - * - * This is displayed in addition to the label in places where additional - * descriptive information is helpful. For example, as help text below the - * form element in entity edit forms. - * - * @return string|null - * The field description, or NULL if no description is available. - */ - public function getDescription(); - - /** - * Returns the maximum number of items allowed for the field. - * - * Possible values are positive integers or - * FieldDefinitionInterface::CARDINALITY_UNLIMITED. - * - * @return integer - * The field cardinality. - */ - public function getCardinality(); - - /** - * Returns whether at least one non-empty item is required for this field. - * - * Currently, required-ness is only enforced at the Form API level in entity - * edit forms, not during direct API saves. - * - * @return bool - * TRUE if the field is required. - */ - public function isRequired(); - - /** - * Returns whether the field can contain multiple items. - * - * @return bool - * TRUE if the field can contain multiple items, FALSE otherwise. - */ - public function isMultiple(); - - /** - * Gets the definition of a contained property. - * - * @param string $name - * The name of property. - * - * @return \Drupal\Core\TypedData\DataDefinitionInterface|null - * The definition of the property or NULL if the property does not exist. - */ - public function getPropertyDefinition($name); - - /** - * Gets an array of property definitions of contained properties. - * - * @return \Drupal\Core\TypedData\DataDefinitionInterface[] - * An array of property definitions of contained properties, keyed by - * property name. - */ - public function getPropertyDefinitions(); - - /** - * Returns the names of the field's subproperties. - * - * A field is a list of items, and each item can contain one or more - * properties. All items for a given field contain the same property names, - * but the values can be different for each item. - * - * For example, an email field might just contain a single 'value' property, - * while a link field might contain 'title' and 'url' properties, and a text - * field might contain 'value', 'summary', and 'format' properties. - * - * @return array - * The property names. - */ - public function getPropertyNames(); - - /** - * Returns the name of the main property, if any. - * - * Some field items consist mainly of one main property, e.g. the value of a - * text field or the @code target_id @endcode of an entity reference. If the - * field item has no main property, the method returns NULL. - * - * @return string|null - * The name of the value property, or NULL if there is none. - */ - public function getMainPropertyName(); - - /** - * Returns the ID of the type of the entity this field is attached to. - * - * This method should not be confused with EntityInterface::entityType() - * (configurable fields are config entities, and thus implement both - * interfaces): - * - FieldDefinitionInterface::getTargetEntityTypeId() answers "as a field, - * which entity type are you attached to?". - * - EntityInterface::getEntityTypeId() answers "as a (config) entity, what - * is your own entity type". - * - * @return string - * The name of the entity type. - */ - public function getTargetEntityTypeId(); - - /** - * Returns the field schema. - * - * Note that this method returns an empty array for computed fields which have - * no schema. - * - * @return array - * The field schema, as an array of key/value pairs in the format returned - * by hook_field_schema(): - * - columns: An array of Schema API column specifications, keyed by column - * name. This specifies what comprises a single value for a given field. - * No assumptions should be made on how storage backends internally use - * the original column name to structure their storage. - * - indexes: An array of Schema API index definitions. Some storage - * backends might not support indexes. - * - foreign keys: An array of Schema API foreign key definitions. Note, - * however, that depending on the storage backend specified for the field, - * the field data is not necessarily stored in SQL. - */ - public function getSchema(); - - /** - * Returns the field columns, as defined in the field schema. - * - * @return array - * The array of field columns, keyed by column name, in the same format - * returned by getSchema(). - * - * @see \Drupal\Core\Field\FieldDefinitionInterface::getSchema() - */ - public function getColumns(); - - /** - * Returns an array of validation constraints. - * - * See \Drupal\Core\TypedData\TypedDataManager::getConstraints() for details. - * - * @return array - * An array of validation constraint definitions, keyed by constraint name. - * Each constraint definition can be used for instantiating - * \Symfony\Component\Validator\Constraint objects. - */ - public function getConstraints(); - - /** - * Returns a validation constraint. - * - * See \Drupal\Core\TypedData\TypedDataManager::getConstraints() for details. - * - * @param string $constraint_name - * The name of the the constraint, i.e. its plugin id. - * - * @return array - * A validation constraint definition which can be used for instantiating a - * \Symfony\Component\Validator\Constraint object. - */ - public function getConstraint($constraint_name); - - /** - * Returns the name of the provider of this field. - * - * @return string - * The provider name; e.g., the module name. - */ - public function getProvider(); - - /** - * Returns the storage behavior for this field. - * - * Indicates whether the entity type's storage should take care of storing the - * field values or whether it is handled separately; e.g. by the - * module providing the field. - * - * @return bool - * FALSE if the storage takes care of storing the field, TRUE otherwise. - */ - public function hasCustomStorage(); - -} diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php index 14d0f83..8440cb4 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class BooleanItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('boolean') ->setLabel(t('Boolean value')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php index c93d494..004100a 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class DateItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('date') ->setLabel(t('Date value')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php index 30d33c5..a3d6232 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -37,7 +37,7 @@ public static function defaultSettings() { * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Decimal value')); @@ -47,7 +47,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php index 6e84507..a5ccb48 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; @@ -27,7 +27,7 @@ class EmailItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('email') ->setLabel(t('E-mail value')); @@ -37,7 +37,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php index 46e4bfa..090a366 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; use Drupal\Core\Entity\TypedData\EntityDataDefinition; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\TypedData\DataReferenceDefinition; @@ -54,7 +54,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $settings = $field_definition->getSettings(); $target_type_info = \Drupal::entityManager()->getDefinition($settings['target_type']); @@ -97,7 +97,7 @@ public static function mainPropertyName() { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { $target_type = $field_definition->getSetting('target_type'); $target_type_info = \Drupal::entityManager()->getDefinition($target_type); diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php index a78ebdb..53f0a4a 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class FloatItem extends NumericItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('float') ->setLabel(t('Float value')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php index 5cf44e62..95236f9 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class IntegerItem extends NumericItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('integer') ->setLabel(t('Integer value')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php index e3192b2..f61935a 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\Language\Language; use Drupal\Core\TypedData\DataDefinition; @@ -33,7 +33,7 @@ class LanguageItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Language code')); @@ -50,7 +50,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php index 26cdc41..3a208eb 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; @@ -26,7 +26,7 @@ class MapItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Serialized values')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php index fe7c4f4..9b947d5 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; @@ -37,7 +37,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Text value')); @@ -47,7 +47,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php index 28fcf08..998bfa8 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; /** * Defines the 'string_long' field type. @@ -24,7 +24,7 @@ class StringLongItem extends StringItem { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/TimestampItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/TimestampItem.php index ba432e3..4d6c345 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/TimestampItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/TimestampItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; @@ -26,7 +26,7 @@ class TimestampItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('timestamp') ->setLabel(t('Timestamp value')); return $properties; @@ -35,7 +35,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php index 693e4ce..031b394 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -38,7 +38,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('uri') ->setLabel(t('URI value')); @@ -48,7 +48,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/lib/Drupal/Core/Field/StorageFieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/StorageFieldDefinitionInterface.php new file mode 100644 index 0000000..735d4b8 --- /dev/null +++ b/core/lib/Drupal/Core/Field/StorageFieldDefinitionInterface.php @@ -0,0 +1,288 @@ +foo returns its data. + * + * @return string + * The field name. + */ + public function getName(); + + /** + * Returns the field type. + * + * @return string + * The field type, i.e. the id of a field type plugin. For example 'text'. + * + * @see \Drupal\Core\Field\FieldTypePluginManagerInterface + */ + public function getType(); + + /** + * Returns the field settings. + * + * Each field type defines the settings that are meaningful for that type. + * For example, a text field can define a 'max_length' setting, and an image + * field can define a 'alt_field_required' setting. + * + * @return array + * An array of key/value pairs. + */ + public function getSettings(); + + /** + * Returns the value of a given field setting. + * + * @param string $setting_name + * The setting name. + * + * @return mixed + * The setting value. + */ + public function getSetting($setting_name); + + /** + * Returns whether the field is translatable. + * + * @return bool + * TRUE if the field is translatable. + */ + public function isTranslatable(); + + /** + * Returns whether the field is revisionable. + * + * @return bool + * TRUE if the field is revisionable. + */ + public function isRevisionable(); + + /** + * Determines whether the field is queryable via QueryInterface. + * + * @return bool + * TRUE if the field is queryable. + */ + public function isQueryable(); + + /** + * Returns the human-readable label for the field. + * + * @return string + * The field label. + */ + public function getLabel(); + + /** + * Returns the human-readable description for the field. + * + * This is displayed in addition to the label in places where additional + * descriptive information is helpful. For example, as help text below the + * form element in entity edit forms. + * + * @return string|null + * The field description, or NULL if no description is available. + */ + public function getDescription(); + + /** + * Returns the maximum number of items allowed for the field. + * + * Possible values are positive integers or + * FieldDefinitionInterface::CARDINALITY_UNLIMITED. + * + * @return integer + * The field cardinality. + */ + public function getCardinality(); + + /** + * Returns whether at least one non-empty item is required for this field. + * + * Currently, required-ness is only enforced at the Form API level in entity + * edit forms, not during direct API saves. + * + * @return bool + * TRUE if the field is required. + */ + public function isRequired(); + + /** + * Returns whether the field can contain multiple items. + * + * @return bool + * TRUE if the field can contain multiple items, FALSE otherwise. + */ + public function isMultiple(); + + /** + * Gets the definition of a contained property. + * + * @param string $name + * The name of property. + * + * @return \Drupal\Core\TypedData\DataDefinitionInterface|null + * The definition of the property or NULL if the property does not exist. + */ + public function getPropertyDefinition($name); + + /** + * Gets an array of property definitions of contained properties. + * + * @return \Drupal\Core\TypedData\DataDefinitionInterface[] + * An array of property definitions of contained properties, keyed by + * property name. + */ + public function getPropertyDefinitions(); + + /** + * Returns the names of the field's subproperties. + * + * A field is a list of items, and each item can contain one or more + * properties. All items for a given field contain the same property names, + * but the values can be different for each item. + * + * For example, an email field might just contain a single 'value' property, + * while a link field might contain 'title' and 'url' properties, and a text + * field might contain 'value', 'summary', and 'format' properties. + * + * @return array + * The property names. + */ + public function getPropertyNames(); + + /** + * Returns the name of the main property, if any. + * + * Some field items consist mainly of one main property, e.g. the value of a + * text field or the @code target_id @endcode of an entity reference. If the + * field item has no main property, the method returns NULL. + * + * @return string|null + * The name of the value property, or NULL if there is none. + */ + public function getMainPropertyName(); + + /** + * Returns the ID of the type of the entity this field is attached to. + * + * This method should not be confused with EntityInterface::entityType() + * (configurable fields are config entities, and thus implement both + * interfaces): + * - FieldDefinitionInterface::getTargetEntityTypeId() answers "as a field, + * which entity type are you attached to?". + * - EntityInterface::getEntityTypeId() answers "as a (config) entity, what + * is your own entity type". + * + * @return string + * The name of the entity type. + */ + public function getTargetEntityTypeId(); + + /** + * Returns the field schema. + * + * Note that this method returns an empty array for computed fields which have + * no schema. + * + * @return array + * The field schema, as an array of key/value pairs in the format returned + * by hook_field_schema(): + * - columns: An array of Schema API column specifications, keyed by column + * name. This specifies what comprises a single value for a given field. + * No assumptions should be made on how storage backends internally use + * the original column name to structure their storage. + * - indexes: An array of Schema API index definitions. Some storage + * backends might not support indexes. + * - foreign keys: An array of Schema API foreign key definitions. Note, + * however, that depending on the storage backend specified for the field, + * the field data is not necessarily stored in SQL. + */ + public function getSchema(); + + /** + * Returns the field columns, as defined in the field schema. + * + * @return array + * The array of field columns, keyed by column name, in the same format + * returned by getSchema(). + * + * @see \Drupal\Core\Field\FieldDefinitionInterface::getSchema() + */ + public function getColumns(); + + /** + * Returns an array of validation constraints. + * + * See \Drupal\Core\TypedData\TypedDataManager::getConstraints() for details. + * + * @return array + * An array of validation constraint definitions, keyed by constraint name. + * Each constraint definition can be used for instantiating + * \Symfony\Component\Validator\Constraint objects. + */ + public function getConstraints(); + + /** + * Returns a validation constraint. + * + * See \Drupal\Core\TypedData\TypedDataManager::getConstraints() for details. + * + * @param string $constraint_name + * The name of the the constraint, i.e. its plugin id. + * + * @return array + * A validation constraint definition which can be used for instantiating a + * \Symfony\Component\Validator\Constraint object. + */ + public function getConstraint($constraint_name); + + /** + * Returns the name of the provider of this field. + * + * @return string + * The provider name; e.g., the module name. + */ + public function getProvider(); + + /** + * Returns the storage behavior for this field. + * + * Indicates whether the entity type's storage should take care of storing the + * field values or whether it is handled separately; e.g. by the + * module providing the field. + * + * @return bool + * FALSE if the storage takes care of storing the field, TRUE otherwise. + */ + public function hasCustomStorage(); + +} diff --git a/core/modules/comment/lib/Drupal/comment/CommentFieldNameItem.php b/core/modules/comment/lib/Drupal/comment/CommentFieldNameItem.php index 94b8587..5a912c8 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFieldNameItem.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFieldNameItem.php @@ -7,7 +7,7 @@ namespace Drupal\comment; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\Plugin\Field\FieldType\StringItem; use Drupal\Core\TypedData\DataDefinition; @@ -19,7 +19,7 @@ class CommentFieldNameItem extends StringItem { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('String value')) ->setClass('\Drupal\comment\CommentFieldNameValue') diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php index dd6e7e8..9f67867 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php @@ -7,7 +7,7 @@ namespace Drupal\comment\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\Session\AnonymousUserSession; @@ -51,7 +51,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['status'] = DataDefinition::create('integer') ->setLabel(t('Comment status value')); @@ -79,7 +79,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'status' => array( diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php index 1d072d7..efc8f25 100644 --- a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php +++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php @@ -7,7 +7,7 @@ namespace Drupal\datetime\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\PrepareCacheInterface; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\Field\FieldItemBase; @@ -48,7 +48,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('datetime_iso8601') ->setLabel(t('Date value')); @@ -65,7 +65,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php index 0184353..c355484 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php @@ -8,7 +8,7 @@ namespace Drupal\entity_reference; use Drupal\Component\Utility\String; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\Core\Session\AccountInterface; use Drupal\Core\TypedData\AllowedValuesInterface; @@ -97,7 +97,7 @@ public function getSettableOptions(AccountInterface $account = NULL) { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $settings = $field_definition->getSettings(); $target_type = $settings['target_type']; @@ -136,7 +136,7 @@ public function getConstraints() { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { $schema = parent::schema($field_definition); $target_type = $field_definition->getSetting('target_type'); diff --git a/core/modules/field/lib/Drupal/field/FieldConfigInterface.php b/core/modules/field/lib/Drupal/field/FieldConfigInterface.php index c6575ec..785605e 100644 --- a/core/modules/field/lib/Drupal/field/FieldConfigInterface.php +++ b/core/modules/field/lib/Drupal/field/FieldConfigInterface.php @@ -8,12 +8,12 @@ namespace Drupal\field; use Drupal\Core\Config\Entity\ConfigEntityInterface; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; /** * Provides an interface defining a field entity. */ -interface FieldConfigInterface extends ConfigEntityInterface, FieldStorageDefinitionInterface { +interface FieldConfigInterface extends ConfigEntityInterface, StorageFieldDefinitionInterface { /** * Returns the list of bundles where the field has instances. diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/HiddenTestItem.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/HiddenTestItem.php index 14b6b3f..a2dca38 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/HiddenTestItem.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/HiddenTestItem.php @@ -7,7 +7,7 @@ namespace Drupal\field_test\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -28,7 +28,7 @@ class HiddenTestItem extends TestItem { * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('integer') ->setLabel(t('Test integer value')); diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php index 87a7f31..42608df 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php @@ -7,7 +7,7 @@ namespace Drupal\field_test\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\Field\FieldItemBase; @@ -36,7 +36,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['shape'] = DataDefinition::create('string') ->setLabel(t('Shape')); @@ -49,7 +49,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { $foreign_keys = array(); // The 'foreign keys' key is not always used in tests. if ($field_definition->getSetting('foreign_key_name')) { diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php index fcc599c..5fe2dd4 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php @@ -7,7 +7,7 @@ namespace Drupal\field_test\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\PrepareCacheInterface; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\Field\FieldItemBase; @@ -49,7 +49,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('integer') ->setLabel(t('Test integer value')); @@ -59,7 +59,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php index 16ada1e..4342754 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php +++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php @@ -7,7 +7,7 @@ namespace Drupal\file\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\Core\TypedData\DataDefinition; @@ -52,7 +52,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'target_id' => array( @@ -90,7 +90,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties = parent::propertyDefinitions($field_definition); $properties['display'] = DataDefinition::create('boolean') diff --git a/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php index 20327d7..7c45449 100644 --- a/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php +++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php @@ -7,7 +7,7 @@ namespace Drupal\image\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; use Drupal\file\Plugin\Field\FieldType\FileItem; @@ -83,7 +83,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'target_id' => array( @@ -130,7 +130,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties = parent::propertyDefinitions($field_definition); $properties['alt'] = DataDefinition::create('string') diff --git a/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php b/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php index 558d1e4..b3a4ce8 100644 --- a/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php +++ b/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php @@ -8,7 +8,7 @@ namespace Drupal\link\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\TypedData\MapDataDefinition; @@ -37,7 +37,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['url'] = DataDefinition::create('uri') ->setLabel(t('URL')); @@ -53,7 +53,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'url' => array( diff --git a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListBooleanItem.php b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListBooleanItem.php index 095c89c..7503a5d 100644 --- a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListBooleanItem.php +++ b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListBooleanItem.php @@ -8,7 +8,7 @@ namespace Drupal\options\Plugin\Field\FieldType; use Drupal\Component\Utility\NestedArray; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\Session\AccountInterface; use Drupal\Core\TypedData\AllowedValuesInterface; @@ -68,7 +68,7 @@ public function getSettableOptions(AccountInterface $account = NULL) { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('boolean') ->setLabel(t('Boolean value')); @@ -78,7 +78,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListFloatItem.php b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListFloatItem.php index 30cd382..5218429 100644 --- a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListFloatItem.php +++ b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListFloatItem.php @@ -7,7 +7,7 @@ namespace Drupal\options\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class ListFloatItem extends ListItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('float') ->setLabel(t('Float value')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListIntegerItem.php b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListIntegerItem.php index c049878..3fc61fc 100644 --- a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListIntegerItem.php +++ b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListIntegerItem.php @@ -7,7 +7,7 @@ namespace Drupal\options\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class ListIntegerItem extends ListItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('integer') ->setLabel(t('Integer value')); @@ -36,7 +36,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListTextItem.php b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListTextItem.php index 621adbe..eefac28 100644 --- a/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListTextItem.php +++ b/core/modules/options/lib/Drupal/options/Plugin/Field/FieldType/ListTextItem.php @@ -7,7 +7,7 @@ namespace Drupal\options\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -26,7 +26,7 @@ class ListTextItem extends ListItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $constraints = array('Length' => array('max' => 255)); $properties['value'] = DataDefinition::create('string') ->setLabel(t('Text value')) @@ -38,7 +38,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php index 3f89b34..154d31e 100644 --- a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php +++ b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php @@ -7,7 +7,7 @@ namespace Drupal\path\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; @@ -26,7 +26,7 @@ class PathItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['alias'] = DataDefinition::create('string') ->setLabel(t('Path alias')); $properties['pid'] = DataDefinition::create('string') @@ -37,7 +37,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array(); } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutPathItem.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutPathItem.php index 8ad82d3..82634f7 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutPathItem.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutPathItem.php @@ -7,7 +7,7 @@ namespace Drupal\shortcut; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\Plugin\Field\FieldType\StringItem; use Drupal\Core\TypedData\DataDefinition; @@ -19,7 +19,7 @@ class ShortcutPathItem extends StringItem { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('String value')) ->setComputed(TRUE) diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index 475e4b1..bb7411b 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -766,7 +766,7 @@ function hook_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\Entit * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. * - * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[] + * @return \Drupal\Core\Field\StorageFieldDefinitionInterface[] * An array of storage field definitions, keyed by field name. * * @see hook_entity_storage_field_info_alter() @@ -789,7 +789,7 @@ function hook_entity_storage_field_info(\Drupal\Core\Entity\EntityTypeInterface /** * Alters storage field definitions for a content entity type. * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $fields + * @param \Drupal\Core\Field\StorageFieldDefinitionInterface[] $fields * The array of storage field definitions for the entity type. * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php index a893063..9a444c8 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\Core\Session\AccountInterface; use Drupal\Core\TypedData\AllowedValuesInterface; @@ -94,7 +94,7 @@ public function getSettableOptions(AccountInterface $account = NULL) { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'target_id' => array( diff --git a/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php b/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php index 2b1a5b6..c9a8268 100644 --- a/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php +++ b/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php @@ -8,7 +8,7 @@ namespace Drupal\telephone\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -27,7 +27,7 @@ class TelephoneItem extends FieldItemBase { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( @@ -42,7 +42,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Telephone number')); diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php index b2ba0a1..1a6eba2 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php +++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php @@ -7,7 +7,7 @@ namespace Drupal\text\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; /** * Plugin implementation of the 'text' field type. @@ -34,7 +34,7 @@ public static function defaultSettings() { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php index 4f2deca..fb2d8de 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php +++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php @@ -8,7 +8,7 @@ namespace Drupal\text\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\Field\PrepareCacheInterface; use Drupal\Core\TypedData\DataDefinition; @@ -29,7 +29,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Text value')); diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php index 367ae19..db2f8d6 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php +++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php @@ -7,7 +7,7 @@ namespace Drupal\text\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; /** * Plugin implementation of the 'text_long' field type. @@ -25,7 +25,7 @@ class TextLongItem extends TextItemBase { /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array( diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php index 0d686e0..ae8cb0e 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php +++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php @@ -7,7 +7,7 @@ namespace Drupal\text\Plugin\Field\FieldType; -use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\Core\Field\StorageFieldDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** @@ -36,7 +36,7 @@ public static function defaultInstanceSettings() { /** * {@inheritdoc} */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { + public static function propertyDefinitions(StorageFieldDefinitionInterface $field_definition) { $properties = parent::propertyDefinitions($field_definition); $properties['summary'] = DataDefinition::create('string') @@ -55,7 +55,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel /** * {@inheritdoc} */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { + public static function schema(StorageFieldDefinitionInterface $field_definition) { return array( 'columns' => array( 'value' => array(