You are here

function _og_devel_generate in Organic groups 7

1 call to _og_devel_generate()
og_devel_generate in ./og.devel_generate.inc
@file Devel generate integration with Organic groups module.
1 string reference to '_og_devel_generate'
og_devel_generate in ./og.devel_generate.inc
@file Devel generate integration with Organic groups module.

File

./og.devel_generate.inc, line 17
Devel generate integration with Organic groups module.

Code

function _og_devel_generate($object, $field, $instance, $bundle) {
  $object_field = array();
  if ($allowed_values = og_get_all_group()) {
    $keys = array_keys($allowed_values);
    $object_field['gid'] = $keys[mt_rand(0, count($allowed_values) - 1)];
  }
  return $object_field;
}