You are here

function _addressfield_devel_generate in Address Field 7

1 call to _addressfield_devel_generate()
addressfield_devel_generate in ./addressfield.devel_generate.inc
1 string reference to '_addressfield_devel_generate'
addressfield_devel_generate in ./addressfield.devel_generate.inc

File

./addressfield.devel_generate.inc, line 24

Code

function _addressfield_devel_generate($object, $field, $instance, $bundle) {

  // Set default value
  $object_field = addressfield_default_values($field, $instance);
  $addresses = _addressfield_sample_addresses();
  $object_field = array_merge($object_field, $addresses[array_rand($addresses)]);
  unset($object_field['data']);
  return $object_field;
}