You are here

function hook_scald_fetch in Scald: Media Management made easy 7

Same name and namespace in other branches
  1. 6 scald_image/scald_image.module \hook_scald_fetch()

Respond to atom fetch (load).

@codingStandardsIgnoreStart

Parameters

ScaldAtom $atom: The atom being created.

string $mode: Role of the callee function. Can have the following values:

  • "type" (not really, as we don't have type provider now).
  • "atom".

See also

hook_scald_register_atom()

4 functions implement hook_scald_fetch()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

scald_audio_scald_fetch in modules/providers/scald_audio/scald_audio.module
Implements hook_scald_fetch().
scald_flash_scald_fetch in modules/providers/scald_flash/scald_flash.module
Implements hook_scald_fetch.
scald_image_scald_fetch in modules/providers/scald_image/scald_image.module
Implements hook_scald_fetch().
scald_video_scald_fetch in modules/providers/scald_video/scald_video.module
Implements hook_scald_fetch().
1 invocation of hook_scald_fetch()
scald_fetch_multiple in ./scald.module
Load multiple Scald Atoms.

File

./scald.api.php, line 303
Hooks related to Scald atoms and providers.

Code

function hook_scald_fetch($atom, $mode) {

  // @codingStandardsIgnoreEnd
  if ($mode == 'atom') {
    $atom->description = 'description';
    $atom->source_file = 'source path';
    $atom->thumbnail_file = 'thumbnail path';

    // Typically, for Atom Providers which are based on Drupal nodes, the $node
    // object is attached to the $atom as the base_entity member.
    $atom->base_entity = node_load($atom->sid);
  }
}