You are here

function _entity_background_get_field in Entity background 7

Get/Create field by $field settings.

Helper function.

Parameters

array $field: An array of field settings.

Return value

array A field.

6 calls to _entity_background_get_field()
entity_background_get_field_color in includes/entity_background.fields_crud.inc
Create color field.
entity_background_get_field_eb_background in includes/entity_background.fields_crud.inc
Create eb_background field.
entity_background_get_field_eb_selection in includes/entity_background.fields_crud.inc
Create eb_selection field.
entity_background_get_field_image in includes/entity_background.fields_crud.inc
Create image field.
entity_background_get_field_list_text in includes/entity_background.fields_crud.inc
Create list text field.

... See full list

File

includes/entity_background.fields_crud.inc, line 425
Fields CRUD functions.

Code

function _entity_background_get_field($field) {

  // Check if the field exists already.
  $field_info = field_info_field($field['field_name']);
  if (empty($field_info)) {
    $field_info = field_create_field($field);
  }
  return $field_info;
}