public function Field::getStorageDetails

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:

Return value

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.

Overrides FieldInterface::getStorageDetails

1 call to Field::getStorageDetails()
Field::offsetGet in drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php

File

drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php, line 527
Contains \Drupal\field\Plugin\Core\Entity\Field.

Class

Field
Defines the Field entity.

Namespace

Drupal\field\Plugin\Core\Entity

Code

public function getStorageDetails() {
  if (!isset($this->storageDetails)) {
    $module_handler = \Drupal::moduleHandler();

    // Collect the storage details from the storage backend, and let other
    // modules alter it. This invokes hook_field_storage_details() and
    // hook_field_storage_details_alter().
    $details = (array) $module_handler
      ->invoke($this->storage['module'], 'field_storage_details', array(
      $this,
    ));
    $module_handler
      ->alter('field_storage_details', $details, $this);
    $this->storageDetails = $details;
  }
  return $this->storageDetails;
}