diff core/modules/help/src/Plugin/HelpSection/HelpSectionPluginBase.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/help/src/Plugin/HelpSection/HelpSectionPluginBase.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\help\Plugin\HelpSection;
+
+use Drupal\Core\Cache\UnchangingCacheableDependencyTrait;
+use Drupal\Core\Plugin\PluginBase;
+use Drupal\help\HelpSectionPluginInterface;
+
+/**
+ * Provides a base class for help section plugins.
+ *
+ * @see \Drupal\help\HelpSectionPluginInterface
+ * @see \Drupal\help\Annotation\HelpSection
+ * @see \Drupal\help\HelpSectionManager
+ */
+abstract class HelpSectionPluginBase extends PluginBase implements HelpSectionPluginInterface {
+
+  use UnchangingCacheableDependencyTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getTitle() {
+    return $this->getPluginDefinition()['title'];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getDescription() {
+    return $this->getPluginDefinition()['description'];
+  }
+
+}