You are here

public function Drupal7::develGenerate in Realistic Dummy Content 7.2

Same name and namespace in other branches
  1. 8.2 api/src/Framework/Drupal7.php \Drupal\realistic_dummy_content_api\Framework\Drupal7::develGenerate()

File

api/src/Framework/Drupal7.php, line 43

Class

Drupal7
Drupal 7-specific code.

Namespace

Drupal\realistic_dummy_content_api\Framework

Code

public function develGenerate($info) {
  module_load_include('inc', 'devel_generate');
  if ($info['entity_type'] == 'node') {

    // See https://www.drupal.org/node/2324027
    $info['users'] = array(
      1,
    );
    $info['title_length'] = 3;
    if ($info['kill']) {
      devel_generate_content_kill($info);
    }
    for ($i = 0; $i < $info['num']; $i++) {
      devel_generate_content_add_node($info);
    }
  }
  elseif ($info['entity_type'] == 'user') {
    devel_create_users($info['num'], $info['kill']);
  }
}