Drupal 8  8.0.2
BreakpointManager Class Reference
Inheritance diagram for BreakpointManager:

Public Member Functions

 __construct (ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, CacheBackendInterface $cache_backend, TranslationInterface $string_translation)
 
 processDefinition (&$definition, $plugin_id)
 
 getBreakpointsByGroup ($group)
 
 getGroups ()
 
 getGroupProviders ($group)
 
 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

 getDiscovery ()
 
 providerExists ($provider)
 
 getGroupLabel ($group)
 
- 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

 $defaults
 
 $themeHandler
 
 $breakpointsByGroup
 
 $instances = array()
 
- 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

Defines a breakpoint plugin manager to deal with breakpoints.

Extension can define breakpoints in a EXTENSION_NAME.breakpoints.yml file contained in the extension's base directory. Each breakpoint has the following structure:

MACHINE_NAME:
label: STRING
mediaQuery: STRING
weight: INTEGER
multipliers:
- STRING

For example:

bartik.mobile:
label: mobile
mediaQuery: '(min-width: 0px)'
weight: 0
multipliers:
- 1x
- 2x

Optionally a breakpoint can provide a group key. By default an extensions breakpoints will be placed in a group labelled with the extension name.

See Also
Plugin API

Constructor & Destructor Documentation

__construct ( ModuleHandlerInterface  $module_handler,
ThemeHandlerInterface  $theme_handler,
CacheBackendInterface  $cache_backend,
TranslationInterface  $string_translation 
)

Constructs a new BreakpointManager instance.

Parameters
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Extension\ThemeHandlerInterface$theme_handlerThe theme handler.
\Drupal\Core\Cache\CacheBackendInterface$cache_backendThe cache backend.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationThe string translation service.

References DefaultPluginManager\alterInfo(), Drupal\moduleHandler(), and DefaultPluginManager\setCacheBackend().

Here is the call graph for this function:

Member Function Documentation

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.

getBreakpointsByGroup (   $group)

{Gets breakpoints for the specified group.

Parameters
string$groupThe breakpoint group to retrieve.
Returns
[] Array of breakpoint plugins keyed by machine name.
}

Implements BreakpointManagerInterface.

References PluginManagerBase\createInstance(), DefaultPluginManager\getDefinitions(), and Cache\PERMANENT.

Referenced by BreakpointManager\getGroupProviders().

Here is the call graph for this function:

Here is the caller graph for this function:

getDiscovery ( )
protected

{}

References Drupal\moduleHandler().

Here is the call graph for this function:

getGroupLabel (   $group)
protected

Gets the label for a breakpoint group.

Parameters
string$groupThe breakpoint group.
Returns
string The label.

References Drupal\moduleHandler(), and t().

Referenced by BreakpointManager\getGroups().

Here is the call graph for this function:

Here is the caller graph for this function:

getGroupProviders (   $group)

{Gets all the providers for the specified breakpoint group.

Parameters
string$groupThe breakpoint group to retrieve.
Returns
array An array keyed by provider name with values of provider type (module or theme).
}

Implements BreakpointManagerInterface.

References BreakpointManager\getBreakpointsByGroup(), and Drupal\moduleHandler().

Here is the call graph for this function:

getGroups ( )

{Gets all the existing breakpoint groups.

Returns
array Array of breakpoint group labels. Keyed by group name.
}

Implements BreakpointManagerInterface.

References DefaultPluginManager\getDefinitions(), BreakpointManager\getGroupLabel(), and Cache\PERMANENT.

Here is the call graph for this function:

processDefinition ( $definition,
  $plugin_id 
)

{}

providerExists (   $provider)
protected

{}

References Drupal\moduleHandler().

Here is the call graph for this function:

Field Documentation

$defaults
protected
Initial value:
= array(
'label' => '',
'mediaQuery' => '',
'weight' => 0,
'multipliers' => array(),
'group' => '',
'class' => 'Drupal\breakpoint\Breakpoint',
'id' => '',
)

{}


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