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