You are here

trait BlazyAdminTrait in Blazy 7

A Trait common for blazy-related plugins.

Provides objects which cannot be instatiated with a DI for when the classes are instantiated/ locked within procedural functions such as Views hooks.

Hierarchy

2 files declare their use of BlazyAdminTrait
BlazyViews.php in src/Plugin/views/style/BlazyViews.php
BlazyViewsFieldPluginBase.php in src/Plugin/views/field/BlazyViewsFieldPluginBase.php

File

src/Form/BlazyAdminTrait.php, line 11

Namespace

Drupal\blazy\Form
View source
trait BlazyAdminTrait {

  /**
   * The blazy admin service.
   *
   * @var \Drupal\blazy\Form\BlazyAdmin
   */
  protected $admin;

  /**
   * Returns the blazy admin service.
   */
  public function admin() {
    if (!isset($this->admin)) {
      $this->admin = new BlazyAdmin($this
        ->manager());
    }
    return $this->admin;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlazyAdminTrait::$admin protected property The blazy admin service.
BlazyAdminTrait::admin public function Returns the blazy admin service.