You are here

trait PropertyManagerTrait in ThemeKey 8

Hierarchy

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

File

src/PropertyManagerTrait.php, line 7

Namespace

Drupal\themekey
View source
trait PropertyManagerTrait {

  /**
   * @var
   */
  private $propertyManager;

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
PropertyManagerTrait::$propertyManager private property @var
PropertyManagerTrait::getPropertyManager protected function Gets the ThemeKey Property manager.
PropertyManagerTrait::setPropertyManager public function Sets the ThemeKey Property manager to use.