You are here

function pm_field_instances_create_if_required in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 includes/pm.field.inc \pm_field_instances_create_if_required()
  2. 7.3 includes/pm.field.inc \pm_field_instances_create_if_required()

Iterate through an array of field instances, creating if not present.

Parameters

array $field_instances: Array of field bases to check.

Return value

array $result Array of success / failure flags.

10 calls to pm_field_instances_create_if_required()
pmexpense_migrate_create_fields in pmexpense/includes/pmexpense.migrate.inc
Creates and attaches fields to Drupal user.
pmissue_migrate_create_fields in pmissue/includes/pmissue.migrate.inc
Creates and attaches fields to Drupal user.
pmnote_migrate_create_fields in pmnote/includes/pmnote.migrate.inc
Creates and attaches fields to Drupal user.
pmorganization_migrate_create_fields in pmorganization/includes/pmorganization.migrate.inc
Creates and attaches fields to Drupal user.
pmperson_migrate_create_fields in pmperson/includes/pmperson.migrate.inc
Creates and attaches fields to Drupal user.

... See full list

File

includes/pm.field.inc, line 70
Field creation functions.

Code

function pm_field_instances_create_if_required(array $field_instances) {
  $result = array();
  if (!empty($field_instances) and is_array($field_instances)) {
    foreach ($field_instances as $key => $field_instance) {
      $field_name = $field_instance['field_name'];
      $result[$key] = pm_field_instance_create_if_required($field_name, $field_instance);
    }
  }
  return $result;
}