interface FieldInterface

Same name in this branch

Provides an interface defining a field entity.

Hierarchy

Expanded class hierarchy of FieldInterface

All classes that implement FieldInterface

1 file declares its use of FieldInterface
Field.php in drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php
Contains \Drupal\field\Plugin\Core\Entity\Field.

File

drupal/core/modules/field/lib/Drupal/field/FieldInterface.php, line 15
Contains \Drupal\field\FieldInterface.

Namespace

Drupal\field
View source
interface FieldInterface extends ConfigEntityInterface, \ArrayAccess, \Serializable {

  /**
   * Returns the field 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 information about how the storage backend stores the field data.
   *
   * The content of the returned value depends on the storage backend, and some
   * storage backends might provide no information.
   *
   * It is strongly discouraged to use this information to perform direct write
   * operations to the field data storage, bypassing the regular field saving
   * APIs.
   *
   * Example return value for the default field_sql_storage backend:
   * - 'sql'
   *   - FIELD_LOAD_CURRENT
   *     - Table name (string).
   *       - Table schema (array)
   *   - FIELD_LOAD_REVISION
   *     - Table name (string).
   *       - Table schema (array).
   *
   * @return array
   *   The storage details.
   *    - The first dimension is a store type (sql, solr, etc).
   *    - The second dimension indicates the age of the values in the store
   *      FIELD_LOAD_CURRENT or FIELD_LOAD_REVISION.
   *    - Other dimensions are specific to the field storage backend.
   */
  public function getStorageDetails();

  /**
   * Returns the list of bundles where the field has instances.
   *
   * @return array
   *   An array keyed by entity type names, whose values are arrays of bundle
   *   names.
   */
  public function getBundles();

}

Members

Namesort descending Modifiers Type Description Overrides
AccessibleInterface::access public function Checks data value access. 5
ComplexDataInterface::get public function Gets a property object. 7
ComplexDataInterface::getProperties public function Gets an array of property objects. 7
ComplexDataInterface::getPropertyDefinition public function Gets the definition of a contained property. 7
ComplexDataInterface::getPropertyDefinitions public function Gets an array of property definitions of contained properties. 7
ComplexDataInterface::getPropertyValues public function Gets an array of property values. 7
ComplexDataInterface::isEmpty public function Determines whether the data structure is empty. 7
ComplexDataInterface::onChange public function React to changes to a child property. 7
ComplexDataInterface::set public function Sets a property value. 7
ComplexDataInterface::setPropertyValues public function Sets multiple property values. 7
ConfigEntityInterface::disable public function Disables the configuration entity. 2
ConfigEntityInterface::enable public function Enables the configuration entity. 2
ConfigEntityInterface::getOriginalID public function Returns the original ID. 2
ConfigEntityInterface::setOriginalID public function Sets the original ID. 2
ConfigEntityInterface::setStatus public function Sets the status of the configuration entity. 2
ConfigEntityInterface::status public function Returns whether the configuration entity is enabled. 2
EntityInterface::bundle public function Returns the bundle of the entity. 3
EntityInterface::createDuplicate public function Creates a duplicate of the entity. 3
EntityInterface::delete public function Deletes an entity permanently. 3
EntityInterface::enforceIsNew public function Enforces an entity to be new. 3
EntityInterface::entityInfo public function Returns the info of the type of the entity. 3
EntityInterface::entityType public function Returns the type of the entity. 3
EntityInterface::getBCEntity public function Gets a backward compatibility decorator entity. 3
EntityInterface::getExportProperties public function Retrieves the exportable properties of the entity. 3
EntityInterface::getNGEntity public function Removes any possible (backward compatibility) decorator in use. 3
EntityInterface::getRevisionId public function Returns the revision identifier of the entity. 3
EntityInterface::id public function Returns the entity identifier (the entity's machine name or numeric ID). 3
EntityInterface::isDefaultRevision public function Checks if this entity is the default revision. 3
EntityInterface::isNew public function Returns whether the entity is new. 3
EntityInterface::isNewRevision public function Returns whether a new revision should be created on save. 3
EntityInterface::isTranslatable public function Returns the translation support status. 3
EntityInterface::label public function Returns the label of the entity. 3
EntityInterface::save public function Saves an entity permanently. 3
EntityInterface::setNewRevision public function Enforces an entity to be saved as a new revision. 3
EntityInterface::uri public function Returns the URI elements of the entity. 3
EntityInterface::uriRelationships public function Returns a list of URI relationships supported by this entity. 3
EntityInterface::uuid public function Returns the entity UUID (Universally Unique Identifier). 3
FieldInterface::getBundles public function Returns the list of bundles where the field has instances. 1
FieldInterface::getSchema public function Returns the field schema. 1
FieldInterface::getStorageDetails public function Returns information about how the storage backend stores the field data. 1
TranslatableInterface::getTranslation public function Gets a translation of the data. 3
TranslatableInterface::getTranslationLanguages public function Returns the languages the data is translated to. 3
TranslatableInterface::language public function Returns the default language. 3
TypedDataInterface::getConstraints public function Gets a list of validation constraints. 4
TypedDataInterface::getDefinition public function Gets the data definition. 4
TypedDataInterface::getName public function Returns the name of a property or item. 4
TypedDataInterface::getParent public function Returns the parent data structure; i.e. either complex data or a list. 4
TypedDataInterface::getPropertyPath public function Returns the property path of the data. 4
TypedDataInterface::getRoot public function Returns the root of the typed data tree. 4
TypedDataInterface::getString public function Returns a string representation of the data. 4
TypedDataInterface::getType public function Gets the data type. 5
TypedDataInterface::getValue public function Gets the data value. 4
TypedDataInterface::setContext public function Sets the context of a property or item via a context aware parent. 4
TypedDataInterface::setValue public function Sets the data value. 4
TypedDataInterface::validate public function Validates the currently set data value. 4