You are here

static function RealisticDummyContentRecipe::FindObjects in Realistic Dummy Content 7

1 call to RealisticDummyContentRecipe::FindObjects()
RealisticDummyContentRecipe::Run in api/includes/RealisticDummyContentRecipe.inc

File

api/includes/RealisticDummyContentRecipe.inc, line 23
Define RealisticDummyContentRecipe autoload class.

Class

RealisticDummyContentRecipe
@file

Code

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 = module_list();
  foreach ($modules as $module) {
    $candidate = $module . '_realistic_dummy_content_recipe';
    if (module_load_include('inc', $module, 'realistic_dummy_content/recipe/' . $module . '.recipe') && class_exists($candidate)) {
      $objects[] = new $candidate();
    }
  }
  return $objects;
}