You are here

function _scald_file_sync_file in Scald File Provider 7

Synchronisation of scald_file field with base_id.

The scald_file field is also the base entity. We keep them in synchronisation when user updates that field.

Parameters

object $atom: Atom.

2 calls to _scald_file_sync_file()
scald_file_scald_register_atom in ./scald_file.module
Implements hook_scald_register_atom().
scald_file_scald_update_atom in ./scald_file.module
Implements hook_scald_update_atom().

File

./scald_file.module, line 255
Scald File is a Scald Atom Provider for Files.

Code

function _scald_file_sync_file($atom) {
  if (!empty($atom->scald_file)) {
    $items = field_get_items('scald_atom', $atom, 'scald_file');
    $atom->base_id = $items[0]['fid'];
  }
}