Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / blazy / src / Plugin / Field / FieldFormatter / BlazyFormatterBaseTrait.php
1 <?php
2
3 namespace Drupal\blazy\Plugin\Field\FieldFormatter;
4
5 /**
6  * A Trait common for blazy image, video and file ER formatters.
7  */
8 trait BlazyFormatterBaseTrait {
9
10   /**
11    * The blazy manager service.
12    *
13    * @var \Drupal\blazy\BlazyFormatterManager
14    */
15   protected $blazyManager;
16
17   /**
18    * Returns the blazy manager.
19    */
20   public function blazyManager() {
21     return $this->blazyManager;
22   }
23
24   /**
25    * Builds the settings.
26    */
27   public function buildSettings() {
28     $settings              = $this->getSettings();
29     $settings['plugin_id'] = $this->getPluginId();
30
31     return $settings;
32   }
33
34   /**
35    * Returns the blazy admin service.
36    */
37   public function admin() {
38     return \Drupal::service('blazy.admin.formatter');
39   }
40
41   /**
42    * {@inheritdoc}
43    */
44   public function settingsSummary() {
45     return $this->admin()->getSettingsSummary($this->getScopedFormElements());
46   }
47
48 }