RealisticDummyContentDevelGenerateGenerator.php in Realistic Dummy Content 3.x
File
api/src/includes/RealisticDummyContentDevelGenerateGenerator.php
View source
<?php
namespace Drupal\realistic_dummy_content_api\includes;
use Drupal\realistic_dummy_content_api\Framework\Framework;
class RealisticDummyContentDevelGenerateGenerator extends RealisticDummyContentGenerator {
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') {
$info = array_merge($info, [
'node_types' => [
$this
->getBundle() => $this
->getBundle(),
],
'users' => [
1,
],
'title_length' => 3,
]);
}
Framework::instance()
->develGenerate($info);
}
}