function field_test_field_load

7.x field_test.field.inc field_test_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age)

Implements hook_field_load().

2 string references to 'field_test_field_load'
FieldBulkDeleteTestCase::testPurgeField in drupal-7.x/modules/field/tests/field.test
Verify that fields are preserved and purged correctly as multiple instances are deleted and purged.
FieldBulkDeleteTestCase::testPurgeInstance in drupal-7.x/modules/field/tests/field.test
Verify that field data items and instances are purged when an instance is deleted.

File

drupal-7.x/modules/field/tests/field_test.field.inc, line 62
Defines a field type and its formatters and widgets.

Code

function field_test_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
  $args = func_get_args();
  field_test_memorize(__FUNCTION__, $args);

  foreach ($items as $id => $item) {
    // To keep the test non-intrusive, only act for instances with the
    // test_hook_field_load setting explicitly set to TRUE.
    if ($instances[$id]['settings']['test_hook_field_load']) {
      foreach ($item as $delta => $value) {
        // Don't add anything on empty values.
        if ($value) {
          $items[$id][$delta]['additional_key'] = 'additional_value';
        }
      }
    }
  }
}