You are here

SimpleGenerator.php in Realistic Dummy Content 8

Define autoload class.

File

api/src/generators/SimpleGenerator.php
View source
<?php

/**
 * @file
 *
 * Define autoload class.
 */
namespace Drupal\realistic_dummy_content_api\generators;

use Drupal\realistic_dummy_content_api\generators\Generator;
class SimpleGenerator extends Generator {

  /**
   * @throws
   *   \Exception
   */
  function _Generate_() {
    for ($i = 0; $i < $this
      ->GetNum(); $i++) {
      $info = array(
        'devel_generate' => TRUE,
      );
      $entity = entity_create($this
        ->GetType(), $info);
      $entity
        ->save();
    }
  }

}

Classes

Namesort descending Description
SimpleGenerator