You are here

trait OperatorManagerTrait in ThemeKey 8

Hierarchy

2 files declare their use of OperatorManagerTrait
Engine.php in src/Engine/Engine.php
ThemeKeyRuleForm.php in src/Form/ThemeKeyRuleForm.php
Contains Drupal\themekey\Form\ThemeKeyRuleForm.

File

src/OperatorManagerTrait.php, line 7

Namespace

Drupal\themekey
View source
trait OperatorManagerTrait {

  /**
   * @var
   */
  private $operatorManager;

  /**
   * Gets the ThemeKey Operator manager.
   *
   * @return \Drupal\Component\Plugin\PluginManagerInterface
   *   The ThemeKey Operator manager.
   */
  protected function getOperatorManager() {
    if (!$this->operatorManager) {
      $this->operatorManager = \Drupal::service('plugin.manager.themekey.operator');
    }
    return $this->operatorManager;
  }

  /**
   * Sets the ThemeKey Property manager to use.
   *
   * @param \Drupal\Component\Plugin\PluginManagerInterface
   *   The ThemeKey Property manager.
   *
   * @return $this
   */
  public function setOperatorManager(PluginManagerInterface $operatorManager) {
    $this->operatorManager = $operatorManager;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OperatorManagerTrait::$operatorManager private property @var
OperatorManagerTrait::getOperatorManager protected function Gets the ThemeKey Operator manager.
OperatorManagerTrait::setOperatorManager public function Sets the ThemeKey Property manager to use.