public static function RealisticDummyContentRecipe::getGenerator in Realistic Dummy Content 8.2
Same name and namespace in other branches
- 7.2 api/src/includes/RealisticDummyContentRecipe.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentRecipe::getGenerator()
- 3.x api/src/includes/RealisticDummyContentRecipe.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentRecipe::getGenerator()
Return a concrete generator class to generate content.
Parameters
array $more: Can contain: kill => TRUE|FALSE.
1 call to RealisticDummyContentRecipe::getGenerator()
- RealisticDummyContentRecipe::newEntities in api/
src/ includes/ RealisticDummyContentRecipe.php - Create new entities.
File
- api/
src/ includes/ RealisticDummyContentRecipe.php, line 93
Class
- RealisticDummyContentRecipe
- Abstract base "recipe" class.
Namespace
Drupal\realistic_dummy_content_api\includesCode
public static function getGenerator($type, $bundle, $count, $more) {
if (in_array($type, array(
'user',
'node',
))) {
if (Framework::instance()
->moduleExists('devel_generate')) {
return new RealisticDummyContentDevelGenerateGenerator($type, $bundle, $count, $more);
}
else {
self::$log
->error(t("Please enable devel's devel_generate module to generate users or nodes."));
}
}
else {
self::$log
->error(t('Entity types other than user and node are not supported for realistic dummy content recipe.'));
}
}