You are here

function custom_breadcrumbs_features_generic_export_item in Custom Breadcrumbs Features 7.2

Generic function to retrieve breadcrumb data.

Parameters

$options: Option of featurized item (= machine name in our case).

$table: Table storing crumbs.

Return value

Crumb data in an array, keyed by its machine name. bid is not exported.

1 call to custom_breadcrumbs_features_generic_export_item()
custom_breadcrumbs_features_generic_export_render in includes/custom_breadcrumbs_features.features.inc
Generic function for hook_features_export_render().

File

includes/custom_breadcrumbs_features.features.inc, line 224
Code to provide custom_breadcrumbs with features integration.

Code

function custom_breadcrumbs_features_generic_export_item($option, $table) {
  $result = db_select($table, 'cb')
    ->fields('cb')
    ->condition('machine_name', $option)
    ->execute();
  $crumb = array();
  if ($result
    ->rowCount() > 0) {
    $crumb = $result
      ->fetchAssoc();

    // We don't need to export the auto-increment value.
    unset($crumb['bid']);
  }
  return array(
    $option => $crumb,
  );
}