You are here

class RealisticDummyContentDevelGenerateGenerator in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/includes/RealisticDummyContentDevelGenerateGenerator.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDevelGenerateGenerator
  2. 3.x api/src/includes/RealisticDummyContentDevelGenerateGenerator.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDevelGenerateGenerator

The "devel generate" dummy content generator.

Hierarchy

Expanded class hierarchy of RealisticDummyContentDevelGenerateGenerator

1 file declares its use of RealisticDummyContentDevelGenerateGenerator
Framework.php in api/src/Framework/Framework.php

File

api/src/includes/RealisticDummyContentDevelGenerateGenerator.php, line 10

Namespace

Drupal\realistic_dummy_content_api\includes
View source
class RealisticDummyContentDevelGenerateGenerator extends RealisticDummyContentGenerator {

  /**
   * {@inheritdoc}
   */
  public function implementGenerate() {
    $info['entity_type'] = $this
      ->getType();
    $info['kill'] = $this
      ->getKill();
    $info['num'] = $this
      ->getNum();
    if (Framework::instance()
      ->moduleExists('comment')) {
      $info['max_comments'] = 5;
    }
    if ($this
      ->getType() == 'node') {

      // See https://www.drupal.org/node/2324027
      $info = array_merge($info, array(
        'node_types' => array(
          $this
            ->getBundle() => $this
            ->getBundle(),
        ),
        'users' => array(
          1,
        ),
        'title_length' => 3,
      ));
    }
    Framework::instance()
      ->develGenerate($info);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RealisticDummyContentDevelGenerateGenerator::implementGenerate public function
RealisticDummyContentGenerator::$bundle private property
RealisticDummyContentGenerator::$more private property
RealisticDummyContentGenerator::$num private property
RealisticDummyContentGenerator::$type private property
RealisticDummyContentGenerator::generate public function Generate content.
RealisticDummyContentGenerator::getBundle public function Getter for the bundle property.
RealisticDummyContentGenerator::getKill public function Getter for the kill property.
RealisticDummyContentGenerator::getNum public function Getter for the num propert.
RealisticDummyContentGenerator::getType public function Getter for the type property.
RealisticDummyContentGenerator::__construct public function Constructor.