You are here

function book_uuid_node_features_export_alter in UUID Features Integration 7

Implements hook_uuid_entity_features_export_alter().

File

includes/modules/book.inc, line 10
uuid_node hooks on behalf of the book module.

Code

function book_uuid_node_features_export_alter(&$export, $node, $module) {
  if (isset($node->book['bid'])) {
    $pipe =& $export['__drupal_alter_by_ref']['pipe'];
    $uuid = current(entity_get_uuid_by_id('node', array(
      $node->book['bid'],
    )));
    $pipe['uuid_book'][$uuid] = $uuid;

    // If a parent is defined add the parent node as dependency.
    if (isset($node->book['plid']) && ($parent_menu_link = book_link_load($node->book['plid']))) {
      $parent_uuid = current(entity_get_uuid_by_id('node', array(
        $parent_menu_link['nid'],
      )));
      if (!empty($parent_uuid)) {
        $pipe['uuid_node'][$uuid] = $uuid;
      }
    }
  }
}