public static function RealisticDummyContentRecipe::findObjects in Realistic Dummy Content 7.2
Same name and namespace in other branches
- 8.2 api/src/includes/RealisticDummyContentRecipe.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentRecipe::findObjects()
- 3.x api/src/includes/RealisticDummyContentRecipe.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentRecipe::findObjects()
Find all recipe objects defined by all modules.
1 call to RealisticDummyContentRecipe::findObjects()
- RealisticDummyContentRecipe::run in api/
src/ includes/ RealisticDummyContentRecipe.php - Run this recipe.
File
- api/
src/ includes/ RealisticDummyContentRecipe.php, line 38
Class
- RealisticDummyContentRecipe
- Abstract base "recipe" class.
Namespace
Drupal\realistic_dummy_content_api\includesCode
public static function findObjects() {
$objects = array();
// We need to cycle through all active modules and look for those
// which contain a class module_name_realistic_dummy_content_recipe
// in the file realistic_dummy_content/recipe/module_name.recipe.inc.
$modules = Framework::instance()
->moduleList();
foreach ($modules as $module) {
$candidate = $module . '_realistic_dummy_content_recipe';
if (self::loadRecipeClass($module) && class_exists($candidate)) {
$objects[] = new $candidate();
}
}
return $objects;
}