You are here

function node_field_get_node_fields_assoc in Node Field 7.2

Rebuild array of node fields for node using machine names as keys of array.

Parameters

object $node: Node to rebuild node_field for.

Return value

array Rebuilt array of node fields.

File

includes/node_field.api.inc, line 211
API and helpers functions for Node Field module.

Code

function node_field_get_node_fields_assoc($node) {
  $assoc_fields = [];
  $fields = node_field_get_node_fields($node);
  if ($fields) {
    foreach ($fields as $field) {
      $assoc_fields[$field['machine_name']] = $field;
    }
    return $assoc_fields;
  }

  // TODO: I think this function should return empty array in case there is no
  // node field in node.
  return FALSE;
}