trait BlazyManagerTrait 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
- trait \Drupal\blazy\BlazyManagerTrait
2 files declare their use of BlazyManagerTrait
- BlazyViews.php in src/
Plugin/ views/ style/ BlazyViews.php - BlazyViewsFieldPluginBase.php in src/
Plugin/ views/ field/ BlazyViewsFieldPluginBase.php
File
- src/
BlazyManagerTrait.php, line 11
Namespace
Drupal\blazyView source
trait BlazyManagerTrait {
/**
* The blazy library service.
*
* @var \Drupal\blazy\BlazyLibrary
*/
protected $library;
/**
* The blazy formatter service.
*
* @var \Drupal\blazy\BlazyFormatter
*/
protected $formatter;
/**
* The blazy manager service.
*
* @var \Drupal\blazy\BlazyManagerInterface
*/
protected $manager;
/**
* Returns the blazy manager.
*/
public function formatter() {
if (!isset($this->formatter)) {
$this->formatter = new BlazyFormatter();
}
return $this->formatter;
}
/**
* Returns the blazy manager.
*/
public function manager() {
if (!isset($this->manager)) {
$this->manager = new BlazyManager();
}
return $this->manager;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlazyManagerTrait:: |
protected | property | The blazy formatter service. | |
BlazyManagerTrait:: |
protected | property | The blazy library service. | |
BlazyManagerTrait:: |
protected | property | The blazy manager service. | |
BlazyManagerTrait:: |
public | function | Returns the blazy manager. | |
BlazyManagerTrait:: |
public | function | Returns the blazy manager. |