You are here

function _name_devel_generate in Name Field 7

Callback function to generate name field instance data.

You can specify another function here to generate your own list.

1 call to _name_devel_generate()
name_devel_generate in ./name.devel_generate.inc
Implements hook_devel_generate().
1 string reference to '_name_devel_generate'
name_devel_generate in ./name.devel_generate.inc
Implements hook_devel_generate().

File

./name.devel_generate.inc, line 27
Devel Generate module integration.

Code

function _name_devel_generate($object, $field, $instance, $bundle) {
  $func = variable_get('name_devel_generate_names', '_name_devel_generate_name');
  $names = $func($field);
  if (!isset($instance['setting']['components'])) {
    $instance['setting']['components'] = array();
  }
  $components = name_get_instance_components($field['settings']['components'], $instance['setting']['components']);
  return array_intersect_key($names[array_rand($names)], array_filter($components));
}