You are here

protected function crumbs_InjectedAPI_hookCrumbsPlugins::entityPlugin in Crumbs, the Breadcrumbs suite 7.2

Parameters

string $type: Either 'title' or 'parent'.

string $key: The plugin key under which this callback will be listed on the weights configuration form.

string|crumbs_EntityPlugin $entity_plugin:

string[]|string|NULL $types: An array of entity types, or a single entity type, or NULL to allow all entity types.

4 calls to crumbs_InjectedAPI_hookCrumbsPlugins::entityPlugin()
crumbs_InjectedAPI_hookCrumbsPlugins::entityParentCallback in lib/InjectedAPI/hookCrumbsPlugins.php
Register a callback that will determine a parent path for a breadcrumb item with an entity route. The behavior will be available for all known entity routes, e.g. node/% or taxonomy/term/%, with different plugin keys.
crumbs_InjectedAPI_hookCrumbsPlugins::entityParentPlugin in lib/InjectedAPI/hookCrumbsPlugins.php
Register an entity parent plugin.
crumbs_InjectedAPI_hookCrumbsPlugins::entityTitleCallback in lib/InjectedAPI/hookCrumbsPlugins.php
Register a callback that will determine a title for a breadcrumb item with an entity route. The behavior will be available for all known entity routes, e.g. node/% or taxonomy/term/%, with different plugin keys.
crumbs_InjectedAPI_hookCrumbsPlugins::entityTitlePlugin in lib/InjectedAPI/hookCrumbsPlugins.php
Register an entity title plugin.

File

lib/InjectedAPI/hookCrumbsPlugins.php, line 156

Class

crumbs_InjectedAPI_hookCrumbsPlugins
API object to be used as an argument for hook_crumbs_plugins() This is a sandbox class, currently not used..

Code

protected function entityPlugin($type, $key, $entity_plugin, $types) {
  if (!isset($entity_plugin)) {
    $class = $this->module . '_CrumbsEntityPlugin';
    $entity_plugin = new $class();
  }
  elseif (is_string($entity_plugin)) {
    $class = $this->module . '_CrumbsEntityPlugin_' . $entity_plugin;
    $entity_plugin = new $class();
  }
  if ($entity_plugin instanceof crumbs_EntityPlugin) {
    $this->entityPluginCollection
      ->entityPlugin($type, $this->module . '.' . $key, $entity_plugin, $types);
  }
}