public function FieldInfo::prepareField

Prepares a field definition for the current run-time context.

Parameters

$field: The raw field structure as read from the database.

Return value

The field definition completed for the current runtime context.

4 calls to FieldInfo::prepareField()
FieldInfo::getBundleInstances in drupal/core/modules/field/lib/Drupal/field/FieldInfo.php
Retrieves the instances for a bundle.
FieldInfo::getField in drupal/core/modules/field/lib/Drupal/field/FieldInfo.php
Returns a field definition from a field name.
FieldInfo::getFieldById in drupal/core/modules/field/lib/Drupal/field/FieldInfo.php
Returns a field definition from a field ID.
FieldInfo::getFields in drupal/core/modules/field/lib/Drupal/field/FieldInfo.php
Returns all active fields, including deleted ones.

File

drupal/core/modules/field/lib/Drupal/field/FieldInfo.php, line 533
Contains \Drupal\field\FieldInfo.

Class

FieldInfo
Provides field and instance definitions for the current runtime environment.

Namespace

Drupal\field

Code

public function prepareField($field) {

  // Make sure all expected field settings are present.
  $field['settings'] += field_info_field_settings($field['type']);
  $field['storage']['settings'] += field_info_storage_settings($field['storage']['type']);
  return $field;
}