function _field_invoke_multiple_default

Invoke field.module's version of a field hook on multiple entities.

This function invokes the field_default_[op]() function. Use _field_invoke_multiple() to invoke the field type implementation, hook_field_[op]().

Parameters

$op: Possible operations include:

  • load
  • prepare_view

For all other operations, use _field_invoke() / field_invoke_default() instead.

$entity_type: The type of entities in $entities; e.g. 'node' or 'user'.

$entities: An array of entities, keyed by entity ID.

$a:

  • The $age parameter in the 'load' operation.
  • Otherwise NULL.

$b: Currently always NULL.

$options: An associative array of additional options, with the following keys:

  • field_name: The name of the field whose operation should be invoked. By default, the operation is invoked on all the fields in the entity's bundle. NOTE: This option is not compatible with the 'deleted' option; the 'field_id' option should be used instead.
  • field_id: The ID of the field whose operation should be invoked. By default, the operation is invoked on all the fields in the entity's bundles.
  • default': A boolean value, specifying which implementation of the operation should be invoked.

    • if FALSE (default), the field types implementation of the operation will be invoked (hook_field_[op])
    • If TRUE, the default field implementation of the field operation will be invoked (field_default_[op])

    Internal use only. Do not explicitely set to TRUE, but use _field_invoke_multiple_default() instead.

  • deleted: If TRUE, the function will operate on deleted fields as well as non-deleted fields. If unset or FALSE, only non-deleted fields are operated on.
  • language: A language code or an array of arrays of language codes keyed by entity ID and field name. It will be used to narrow down to a single value the available languages to act on.

Return value

An array of returned values keyed by entity ID.

See also

_field_invoke_multiple()

Related topics

File

drupal/core/modules/field/field.attach.inc, line 643
Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.

Code

function _field_invoke_multiple_default($op, $entity_type, $entities, &$a = NULL, &$b = NULL, $options = array()) {
  $options['default'] = TRUE;
  return _field_invoke_multiple($op, $entity_type, $entities, $a, $b, $options);
}