You are here

function _crumbs_get_objects_by_method in Crumbs, the Breadcrumbs suite 6

Collect plugin objects, but sorted/keyed in a special way

File

./crumbs.module, line 162

Code

function _crumbs_get_objects_by_method() {
  $sort_order = _crumbs_get_settings();
  $objects = _crumbs_get_objects();
  foreach ($sort_order as $key => $enabled) {
    if (!$enabled) {
      unset($objects[$key]);
    }
  }
  $objects_by_method = array(
    '.' => array(),
    'find' => array(),
  );
  foreach ($objects as $k => $object) {
    if (!is_object($object)) {
      continue;
    }
    $objects_by_method['.'][$k] = $object;
    foreach (get_class_methods($object) as $method) {
      $objects_by_method[$method][$k] = $object;
    }
  }
  return $objects_by_method;
}