You are here

class UiPatterns in UI Patterns 8

UI Patterns factory class.

@package Drupal\ui_patterns

Hierarchy

Expanded class hierarchy of UiPatterns

6 files declare their use of UiPatterns
Pattern.php in src/Element/Pattern.php
PatternPreview.php in src/Element/PatternPreview.php
UiPatternsManagerTest.php in tests/src/Kernel/UiPatternsManagerTest.php
ui_patterns.module in ./ui_patterns.module
Contains ui_patterns.module.
ui_patterns_layouts.module in modules/ui_patterns_layouts/ui_patterns_layouts.module
Contains module file.

... See full list

File

src/UiPatterns.php, line 10

Namespace

Drupal\ui_patterns
View source
class UiPatterns {

  /**
   * Get pattern manager instance.
   *
   * @return \Drupal\ui_patterns\UiPatternsManager
   *   UI Patterns manager instance.
   */
  public static function getManager() {
    return \Drupal::service('plugin.manager.ui_patterns');
  }

  /**
   * Get pattern field sources manager instance.
   *
   * @return \Drupal\ui_patterns\UiPatternsSourceManager
   *   UI Patterns field sources manager instance.
   */
  public static function getSourceManager() {
    return \Drupal::service('plugin.manager.ui_patterns_source');
  }

  /**
   * Get pattern definition.
   *
   * @param string $id
   *   Pattern ID.
   *
   * @return \Drupal\ui_patterns\Definition\PatternDefinition
   *   Pattern object instance.
   */
  public static function getPatternDefinition($id) {
    return \Drupal::service('plugin.manager.ui_patterns')
      ->getDefinition($id);
  }

  /**
   * Get pattern definitions.
   *
   * @return \Drupal\ui_patterns\Definition\PatternDefinition[]
   *   Pattern object instance.
   */
  public static function getPatternDefinitions() {
    return \Drupal::service('plugin.manager.ui_patterns')
      ->getDefinitions();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UiPatterns::getManager public static function Get pattern manager instance.
UiPatterns::getPatternDefinition public static function Get pattern definition.
UiPatterns::getPatternDefinitions public static function Get pattern definitions.
UiPatterns::getSourceManager public static function Get pattern field sources manager instance.