Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BreakpointManager.php

function BreakpointManager::processDefinition

Overrides DefaultPluginManager::processDefinition

File

core/modules/breakpoint/src/BreakpointManager.php, line 133

Class

BreakpointManager
Defines a breakpoint plugin manager to deal with breakpoints.

Namespace

Drupal\breakpoint

Code

public function processDefinition(&$definition, $plugin_id) {
    parent::processDefinition($definition, $plugin_id);
    // Allow custom groups and therefore more than one group per extension.
    if (empty($definition['group'])) {
        $definition['group'] = $definition['provider'];
    }
    // Ensure a 1x multiplier exists.
    if (!in_array('1x', $definition['multipliers'])) {
        $definition['multipliers'][] = '1x';
    }
    // Ensure that multipliers are sorted numerically so 1x, 1.5x and 2x
    // come out in that order instead of 1.5x, 1x, 2x.
    sort($definition['multipliers'], SORT_NUMERIC);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal