function _field_info_field_cache

Retrieves the Drupal\field\FieldInfo object for the current request.

Return value

Drupal\field\FieldInfo An instance of the Drupal\field\FieldInfo class.

8 calls to _field_info_field_cache()
field_info_extra_fields in drupal/core/modules/field/field.info.inc
Returns a list and settings of pseudo-field elements in a given bundle.
field_info_field in drupal/core/modules/field/field.info.inc
Returns data about an individual field, given a field name.
field_info_fields in drupal/core/modules/field/field.info.inc
Returns all field definitions.
field_info_field_by_id in drupal/core/modules/field/field.info.inc
Returns data about an individual field, given a field ID.
field_info_field_by_ids in drupal/core/modules/field/field.info.inc
Returns the same data as field_info_field_by_id() for every field.

... See full list

File

drupal/core/modules/field/field.info.inc, line 17
Field Info API, providing information about available fields and field types.

Code

function _field_info_field_cache() {

  // Use the advanced drupal_static() pattern, since this is called very often.
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['field_info_field_cache'] =& drupal_static(__FUNCTION__);
  }
  $info =& $drupal_static_fast['field_info_field_cache'];
  if (!isset($info)) {
    $info = new FieldInfo();
  }
  return $info;
}