You are here

function fe_profile_features_export_render in Features Extra 7

Implements hook_features_export_render().

File

fe_profile/fe_profile.module, line 53
Main functions and hook implementations for FE Profile.

Code

function fe_profile_features_export_render($module_name, $data) {
  $items = array();
  $table = 'profile_field';
  foreach ($data as $key) {
    $field = db_query("SELECT * FROM {{$table}} WHERE name = :profile_field_name", array(
      ':profile_field_name' => $key,
    ))
      ->fetchObject();
    $items[$key] = $field;
  }
  $code = "  \$items = " . features_var_export($items, '  ') . ";\n";
  $code .= '  return $items;';
  return array(
    'fe_profile_export_fields' => $code,
  );
}