You are here

function node_field_get_node_fields in Node Field 7.2

Get node fields for node.

Parameters

object $node: Node to populate node_fields for.

Return value

array Array of node fields.

7 calls to node_field_get_node_fields()
node_field_copy_node_fields in includes/node_field.api.inc
Copy node fields from one node to another.
node_field_get_node_fields_assoc in includes/node_field.api.inc
Rebuild array of node fields for node using machine names as keys of array.
node_field_node_delete in ./node_field.module
Implements hook_node_delete().
node_field_node_field_form in includes/node_field.form.node_field.inc
Node field form.
node_field_node_form_edit in includes/node_field.form.inc
Add node fields to node edit form.

... See full list

File

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

Code

function node_field_get_node_fields($node) {

  // Init node node_fields param if it doesn't exist yet.
  if (!node_field_is_node_fields_init($node)) {
    node_field_init_node_fields($node);
  }

  // Return array of node fields if there are any.
  if (!empty($node->node_fields)) {
    return $node->node_fields;
  }

  // TODO: I think it's better to always store array in node_fields and return
  // empty array if there are no node_fields for node. This will allow us to
  // get rid of additional checks.
  return FALSE;
}