You are here

function eck_bundle_features_export_render in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7.2 eck.features.inc \eck_bundle_features_export_render()

Implements hook_features_export_render().

File

./eck.features.inc, line 183
Integration with the Features module.

Code

function eck_bundle_features_export_render($module, $data, $export = NULL) {
  $elements = array(
    'machine_name' => NULL,
    'entity_type' => NULL,
    'name' => NULL,
    'label' => NULL,
    'config' => NULL,
  );
  $output = array();
  $output[] = '  $items = array(';
  foreach ($data as $bundle_machine_name) {
    $bundle = Bundle::loadByMachineName($bundle_machine_name);
    unset($bundle->id);
    foreach ($elements as $key => $value) {
      $elements[$key] = $bundle->{$key};
    }
    $output[] = "    '{$bundle->machine_name}' => " . features_var_export($elements, '    ') . ",";
  }
  $output[] = '  );';
  $output[] = '  return $items;';
  return array(
    'eck_bundle_info' => implode("\n", $output),
  );
}