You are here

private function crumbs_InjectedAPI_Collection_PluginCollection::analyzeRoutePluginMethods in Crumbs, the Breadcrumbs suite 7.2

Parameters

string $route:

string $plugin_key:

crumbs_PluginInterface $plugin:

Return value

string[][] Format: $['findParent']['node/%'] = 'findParent__node_x' Any legacy methods.

1 call to crumbs_InjectedAPI_Collection_PluginCollection::analyzeRoutePluginMethods()
crumbs_InjectedAPI_Collection_PluginCollection::addPlugin in lib/InjectedAPI/Collection/PluginCollection.php

File

lib/InjectedAPI/Collection/PluginCollection.php, line 187

Class

crumbs_InjectedAPI_Collection_PluginCollection

Code

private function analyzeRoutePluginMethods($route, $plugin_key, crumbs_PluginInterface $plugin) {
  $method_suffix = crumbs_Util::buildMethodSuffix($route);
  $legacyMethods = array();
  $wildcardKey = $plugin instanceof crumbs_MultiPlugin ? $plugin_key . '.*' : $plugin_key;
  foreach (array(
    'findTitle',
    'findParent',
  ) as $base_method_name) {
    if (!empty($method_suffix)) {
      $method_with_suffix = $base_method_name . '__' . $method_suffix;
      if (method_exists($plugin, $method_with_suffix)) {
        $this->routePluginMethods[$base_method_name][$route][$plugin_key] = true;
        $this->pluginRouteMethods[$wildcardKey][$base_method_name][$route] = true;
        $legacyMethods[$base_method_name][$route] = $method_with_suffix;
        continue;
      }
    }
    if (method_exists($plugin, $base_method_name)) {
      $this->routePluginMethods[$base_method_name][$route][$plugin_key] = true;
      $this->pluginRouteMethods[$wildcardKey][$base_method_name][$route] = true;
    }
  }
  return $legacyMethods;
}