You are here

function isbn_content_generate in ISBN Field 6

Implementation of hook_content_generate().

File

./isbn.module, line 570
Defines ISBN field types.

Code

function isbn_content_generate($node, $field) {
  $random_isbn = '';
  for ($i = 1; $i <= $field['isbn_format']; $i++) {
    $random_isbn .= mt_rand(0, 9);
  }
  return array(
    'value' => $random_isbn,
  );
}