You are here

function _advpoll_field_devel_generate in Advanced Poll 7.3

Fills compound fields with appropriate values.

1 call to _advpoll_field_devel_generate()
advpoll_field_devel_generate in advpoll_field/advpoll_field.devel_generate.inc
Called by Devel Generator when an Advanced Poll node is generated.
1 string reference to '_advpoll_field_devel_generate'
advpoll_field_devel_generate in advpoll_field/advpoll_field.devel_generate.inc
Called by Devel Generator when an Advanced Poll node is generated.

File

advpoll_field/advpoll_field.devel_generate.inc, line 25
Advanced Poll Field Devel Generator

Code

function _advpoll_field_devel_generate($object, $field, $instance, $bundle) {
  $object_field = array();
  if ($instance['widget']['type'] == 'advpoll_write_in') {
    $object_field['choice_id'] = dechex(time() * rand(5, 50));
    $object_field['choice'] = devel_create_greeking(4);
    $object_field['write_in'] = 0;
  }
  return $object_field;
}