You are here

trait PropertyAdminManagerTrait in ThemeKey 8

Hierarchy

1 file declares its use of PropertyAdminManagerTrait
ThemeKeyRuleForm.php in src/Form/ThemeKeyRuleForm.php
Contains Drupal\themekey\Form\ThemeKeyRuleForm.

File

src/PropertyAdminManagerTrait.php, line 7

Namespace

Drupal\themekey
View source
trait PropertyAdminManagerTrait {

  /**
   * @var
   */
  private $propertyAdminManager;

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
PropertyAdminManagerTrait::$propertyAdminManager private property @var
PropertyAdminManagerTrait::getPropertyAdminManager protected function Gets the ThemeKey Property manager.
PropertyAdminManagerTrait::setPropertyAdminManager public function Sets the ThemeKey Property manager to use.