function _scald_image_sync_thumbnail in Scald: Media Management made easy 7
Synchronisation of thumbnail with base_id.
The thumbnail field is also the base entity. We keep them in synchronisation when user update that field.
2 calls to _scald_image_sync_thumbnail()
- scald_image_scald_register_atom in modules/
providers/ scald_image/ scald_image.module - Implements hook_scald_register_atom().
- scald_image_scald_update_atom in modules/
providers/ scald_image/ scald_image.module - Implements hook_scald_update_atom().
File
- modules/
providers/ scald_image/ scald_image.module, line 338 - Scald Image is a Scald Atom Provider for images.
Code
function _scald_image_sync_thumbnail($atom) {
if (!empty($atom->scald_thumbnail)) {
$items = field_get_items('scald_atom', $atom, 'scald_thumbnail');
$atom->base_id = $items[0]['fid'];
}
}