You are here

function editor_note_field_load in Editor Notes 7

Implements hook_field_load().

Defines custom load behavior for the field properties available in entity object.

File

./editor_note.module, line 960
Main functionality for Editor Notes module.

Code

function editor_note_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
  if ($field['type'] == 'editor_note') {
    foreach ($entities as $id => $entity) {
      $delta = 0;
      $notes = editor_note_get_notes($entity_type, $entity, $field, TRUE);
      foreach ($notes as $note_id) {
        $items[$id][$delta]['editor_note_id'] = $note_id;
        $delta++;
      }
    }
  }
}