Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Update / UpdateBase.php
1 <?php
2
3 namespace Drupal\bootstrap\Plugin\Update;
4
5 use Drupal\bootstrap\Bootstrap;
6 use Drupal\bootstrap\Plugin\PluginBase;
7 use Drupal\bootstrap\Theme;
8
9 /**
10  * Base class for an update.
11  *
12  * @ingroup plugins_update
13  */
14 class UpdateBase extends PluginBase implements UpdateInterface {
15
16   /**
17    * {@inheritdoc}
18    */
19   public function getDescription() {
20     return isset($this->pluginDefinition['description']) ? $this->pluginDefinition['description'] : NULL;
21   }
22
23   /**
24    * {@inheritdoc}
25    */
26   public function getLabel() {
27     return !empty($this->pluginDefinition['label']) ? $this->pluginDefinition['label'] : NULL;
28   }
29
30   /**
31    * {@inheritdoc}
32    */
33   public function getProvider() {
34     return isset($this->pluginDefinition['provider']) ? $this->pluginDefinition['provider'] : FALSE;
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function getSchema() {
41     return (int) $this->getPluginId();
42   }
43
44   /**
45    * {@inheritdoc}
46    */
47   public function getSeverity() {
48     return isset($this->pluginDefinition['severity']) ? $this->pluginDefinition['severity'] : FALSE;
49   }
50
51   /**
52    * {@inheritdoc}
53    */
54   public function getTheme() {
55     return Bootstrap::getTheme($this->pluginDefinition['provider']);
56   }
57
58   /**
59    * {@inheritdoc}
60    */
61   public function isPrivate() {
62     return !empty($this->pluginDefinition['private']);
63   }
64
65   /**
66    * {@inheritdoc}
67    */
68   public function process(Theme $theme, array &$context) {}
69
70   /*************************
71    * Deprecated methods.
72    *************************/
73
74   /**
75    * {@inheritdoc}
76    *
77    * @deprecated 8.x-3.0-rc2, will be removed before 8.x-3.0 is released.
78    *
79    * @see \Drupal\bootstrap\Plugin\Update\UpdateBase::getSeverity
80    */
81   public function getLevel() {
82     return $this->getSeverity();
83   }
84
85   /**
86    * {@inheritdoc}
87    *
88    * @deprecated 8.x-3.0-rc2, will be removed before 8.x-3.0 is released.
89    *
90    * @see \Drupal\bootstrap\Plugin\Update\UpdateBase::getLabel
91    */
92   public function getTitle() {
93     return $this->getLabel();
94   }
95
96 }