You are here

function Utils::wf_crm_get_field in Webform CiviCRM Integration 8.5

Get a field based on its short or full name

Parameters

string $key:

Return value

array|null

Overrides UtilsInterface::wf_crm_get_field

File

src/Utils.php, line 496
Webform CiviCRM module's common utility functions.

Class

Utils

Namespace

Drupal\webform_civicrm

Code

function wf_crm_get_field($key) {
  $fields = $this
    ->wf_crm_get_fields();
  if (isset($fields[$key])) {
    return $fields[$key];
  }
  if ($pieces = $this
    ->wf_crm_explode_key($key)) {
    list(, , , , $table, $name) = $pieces;
    if (isset($fields[$table . '_' . $name])) {
      return $fields[$table . '_' . $name];
    }
  }
}