You are here

function _machine_name_devel_generate in Machine name 7

Same name and namespace in other branches
  1. 7.2 machine_name.devel_generate.inc \_machine_name_devel_generate()
1 call to _machine_name_devel_generate()
machine_name_devel_generate in ./machine_name.devel_generate.inc
@file Support creating machine name values via devel_generate.
1 string reference to '_machine_name_devel_generate'
machine_name_devel_generate in ./machine_name.devel_generate.inc
@file Support creating machine name values via devel_generate.

File

./machine_name.devel_generate.inc, line 15
Support creating machine name values via devel_generate.

Code

function _machine_name_devel_generate($object, $field, $instance, $bundle) {
  $object_field = array();

  // Generate a value that respects max_length.
  if (empty($field['settings']['max_length'])) {
    $field['settings']['max_length'] = 12;
  }
  $object_field['value'] = user_password($field['settings']['max_length']);
  return $object_field;
}