You are here

function scald_example_content_type_get_atom in Scald: Media Management made easy 6

Returns an atom based on the node information.

2 calls to scald_example_content_type_get_atom()
scald_example_content_type_node_insert in scald_example_content_type/scald_example_content_type.module
Implements hook_node_insert.
scald_example_content_type_node_update in scald_example_content_type/scald_example_content_type.module
Implements hook_node_update.

File

scald_example_content_type/scald_example_content_type.module, line 69
Contains an example implementation of a node type that will be used to provide atoms to Scald. For this example sake, we(ll be providing Image atoms based on pictures attached to this node.

Code

function scald_example_content_type_get_atom($node) {
  $atom = new stdClass();
  $atom->type = 'image';
  $atom->provider = $node->type;
  $atom->base_id = $node->nid;
  $atom->publisher = $node->uid;
  $atom->title = $node->title;
  $aid = scald_uid_to_aid($node->uid);
  $atom->authors = array(
    $aid,
  );
  if (isset($node->scald_sid)) {
    $atom->sid = $node->scald_sid;
  }
  return $atom;
}