class RealisticDummyContentDevelGenerateGenerator in Realistic Dummy Content 3.x
Same name and namespace in other branches
- 8.2 api/src/includes/RealisticDummyContentDevelGenerateGenerator.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDevelGenerateGenerator
- 7.2 api/src/includes/RealisticDummyContentDevelGenerateGenerator.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDevelGenerateGenerator
The "devel generate" dummy content generator.
Hierarchy
- class \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentGenerator
- class \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDevelGenerateGenerator
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\includesView 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, [
'node_types' => [
$this
->getBundle() => $this
->getBundle(),
],
'users' => [
1,
],
'title_length' => 3,
]);
}
Framework::instance()
->develGenerate($info);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RealisticDummyContentDevelGenerateGenerator:: |
public | function |
Generate content. Used internally in the class. Overrides RealisticDummyContentGenerator:: |
|
RealisticDummyContentGenerator:: |
private | property | The bundle of the entity to generate. | |
RealisticDummyContentGenerator:: |
private | property | Whether or not to kill previous content. | |
RealisticDummyContentGenerator:: |
private | property | Placeholder for more information about this entity generation. | |
RealisticDummyContentGenerator:: |
private | property | The amount of entities to generate. | |
RealisticDummyContentGenerator:: |
private | property | The type of entity to generate. | |
RealisticDummyContentGenerator:: |
public | function | Generate content. | |
RealisticDummyContentGenerator:: |
public | function | Getter for the bundle property. | |
RealisticDummyContentGenerator:: |
public | function | Getter for the kill property. | |
RealisticDummyContentGenerator:: |
public | function | Getter for the num propert. | |
RealisticDummyContentGenerator:: |
public | function | Getter for the type property. | |
RealisticDummyContentGenerator:: |
public | function | Constructor. |