You are here

trait RuleChainManagerTrait in ThemeKey 8

Hierarchy

3 files declare their use of RuleChainManagerTrait
ConfigImportEventSubscriber.php in src/EventSubscriber/ConfigImportEventSubscriber.php
Engine.php in src/Engine/Engine.php
ThemeKeyRuleChainForm.php in src/Form/ThemeKeyRuleChainForm.php

File

src/RuleChainManagerTrait.php, line 7

Namespace

Drupal\themekey
View source
trait RuleChainManagerTrait {

  /**
   * @var
   */
  private $ruleChainManager;

  /**
   * Gets the ThemeKey Rule Chain manager.
   *
   * @return \Drupal\themekey\RuleChainManagerInterface
   *   The ThemeKey Rule Chain manager.
   */
  protected function getRuleChainManager() {
    if (!$this->ruleChainManager) {
      $this->ruleChainManager = \Drupal::service('themekey.rule_chain_manager');
    }
    return $this->ruleChainManager;
  }

  /**
   * Sets the ThemeKey Rule Chain manager to use.
   *
   * @param \Drupal\themekey\RuleChainManagerInterface
   *   The ThemeKey Rule Chain manager.
   *
   * @return $this
   */
  public function setRuleChainManager(RuleChainManagerInterface $ruleChainManager) {
    $this->ruleChainManager = $ruleChainManager;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RuleChainManagerTrait::$ruleChainManager private property @var
RuleChainManagerTrait::getRuleChainManager protected function Gets the ThemeKey Rule Chain manager. 1
RuleChainManagerTrait::setRuleChainManager public function Sets the ThemeKey Rule Chain manager to use.