Drupal 8  8.0.2
ElementInfoManager Class Reference
Inheritance diagram for ElementInfoManager:

Public Member Functions

 __construct (\Traversable $namespaces, CacheBackendInterface $cache_backend, CacheTagsInvalidatorInterface $cache_tag_invalidator, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager)
 
 getInfo ($type)
 
 getInfoProperty ($type, $property_name, $default=NULL)
 
 createInstance ($plugin_id, array $configuration=array())
 
 clearCachedDefinitions ()
 
- Public Member Functions inherited from DefaultPluginManager
 __construct ($subdir,\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface=NULL, $plugin_definition_annotation_name= 'Drupal\Component\Annotation\Plugin')
 
 setCacheBackend (CacheBackendInterface $cache_backend, $cache_key, array $cache_tags=array())
 
 getDefinitions ()
 
 clearCachedDefinitions ()
 
 useCaches ($use_caches=FALSE)
 
 processDefinition (&$definition, $plugin_id)
 
- Public Member Functions inherited from PluginManagerBase
 getDefinition ($plugin_id, $exception_on_invalid=TRUE)
 
 getDefinitions ()
 
 createInstance ($plugin_id, array $configuration=array())
 
 getInstance (array $options)
 
- Public Member Functions inherited from DiscoveryInterface
 hasDefinition ($plugin_id)
 

Protected Member Functions

 buildInfo ($theme_name)
 
 getCid ($theme_name)
 
- Protected Member Functions inherited from DefaultPluginManager
 alterInfo ($alter_hook)
 
 getCachedDefinitions ()
 
 setCachedDefinitions ($definitions)
 
 getDiscovery ()
 
 getFactory ()
 
 findDefinitions ()
 
 alterDefinitions (&$definitions)
 
 providerExists ($provider)
 
- Protected Member Functions inherited from PluginManagerBase
 getDiscovery ()
 
 getFactory ()
 

Protected Attributes

 $elementInfo
 
 $themeManager
 
 $cacheTagInvalidator
 
- Protected Attributes inherited from DefaultPluginManager
 $cacheKey
 
 $cacheTags = array()
 
 $alterHook
 
 $subdir
 
 $moduleHandler
 
 $defaults = array()
 
 $pluginDefinitionAnnotationName
 
 $pluginInterface
 
 $namespaces
 
- Protected Attributes inherited from PluginManagerBase
 $discovery
 
 $factory
 
 $mapper
 

Detailed Description

Provides a plugin manager for element plugins.

See Also
Plugin API

Constructor & Destructor Documentation

__construct ( \Traversable  $namespaces,
CacheBackendInterface  $cache_backend,
CacheTagsInvalidatorInterface  $cache_tag_invalidator,
ModuleHandlerInterface  $module_handler,
ThemeManagerInterface  $theme_manager 
)

Constructs a ElementInfoManager object.

Parameters
\Traversable$namespacesAn object that implements which contains the root paths keyed by the corresponding namespace to look for plugin implementations.
\Drupal\Core\Cache\CacheBackendInterface$cache_backendCache backend instance to use.
\Drupal\Core\Cache\CacheTagsInvalidatorInterface$cache_tag_invalidatorThe cache tag invalidator.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler to invoke the alter hook with.
\Drupal\Core\Theme\ThemeManagerInterface$theme_managerThe theme manager.

References DefaultPluginManager\setCacheBackend().

Here is the call graph for this function:

Member Function Documentation

buildInfo (   $theme_name)
protected

Builds up all element information.

Parameters
string$theme_nameThe theme name.
Returns
array

References ElementInfoManager\createInstance(), ElementInfoManager\getCid(), DefaultPluginManager\getDefinitions(), Drupal\moduleHandler(), and Cache\PERMANENT.

Referenced by ElementInfoManager\getInfo().

Here is the call graph for this function:

Here is the caller graph for this function:

clearCachedDefinitions ( )

{Clears static and persistent plugin definition caches.Don't resort to calling ::cache()->delete() and friends to make Drupal detect new or updated plugin definitions. Always use this method on the appropriate plugin type's plugin manager!}

Implements CachedDiscoveryInterface.

createInstance (   $plugin_id,
array  $configuration = array() 
)

{Creates a pre-configured instance of a plugin.

Parameters
string$plugin_idThe ID of the plugin being instantiated.
array$configurationAn array of configuration relevant to the plugin instance.
Returns
object A fully configured plugin instance.
Exceptions
\Drupal\Component\Plugin\Exception\PluginExceptionIf the instance cannot be created, such as if the ID is invalid.
}

Returns

Implements FactoryInterface.

Referenced by ElementInfoManager\buildInfo().

Here is the caller graph for this function:

getCid (   $theme_name)
protected

Returns the CID used to cache the element info.

Parameters
string$theme_nameThe theme name.
Returns
string

Referenced by ElementInfoManager\buildInfo().

Here is the caller graph for this function:

getInfo (   $type)

{Retrieves the default properties for the defined element type.Each of the form element types defined by this hook is assumed to have a matching theme hook, which should be registered with hook_theme() as normal.For more information about custom element types see the explanation at https://www.drupal.org/node/169815.

Parameters
string$typeThe machine name of an element type plugin.
Returns
array An associative array describing the element types being defined. The array contains a sub-array for each element type, with the machine-readable type name as the key. Each sub-array has a number of possible attributes:
  • #input: boolean indicating whether or not this element carries a value (even if it's hidden).
  • #process: array of callback functions taking $element, $form_state, and $complete_form.
  • #after_build: array of callables taking $element and $form_state.
  • #validate: array of callback functions taking $form and $form_state.
  • #element_validate: array of callback functions taking $element and $form_state.
  • #pre_render: array of callables taking $element.
  • #post_render: array of callables taking $children and $element.
  • #submit: array of callback functions taking $form and $form_state.
  • #title_display: optional string indicating if and how #title should be displayed (see form-element.html.twig).
See Also
::getInfo()
}

Implements ElementInfoManagerInterface.

References ElementInfoManager\buildInfo().

Referenced by ElementInfoManager\getInfoProperty().

Here is the call graph for this function:

Here is the caller graph for this function:

getInfoProperty (   $type,
  $property_name,
  $default = NULL 
)

{Retrieves a single property for the defined element type.

Parameters
string$typeAn element type as defined by an element plugin.
string$property_nameThe property within the element type that should be returned.
$default(Optional) The value to return if the element type does not specify a value for the property. Defaults to NULL.
Returns
string The property value of the defined element type. Or the provided default value, which can be NULL.
}

Implements ElementInfoManagerInterface.

References ElementInfoManager\getInfo().

Here is the call graph for this function:


The documentation for this class was generated from the following file: