Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / lib / Drupal / Core / Plugin / PluginFormBase.php
1 <?php
2
3 namespace Drupal\Core\Plugin;
4
5 use Drupal\Component\Plugin\PluginAwareInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7 use Drupal\Core\Form\FormStateInterface;
8
9 /**
10  * Provides a base class for plugin forms.
11  *
12  * Classes extending this can be in any namespace, but are commonly placed in
13  * the 'PluginForm' namespace, such as \Drupal\module_name\PluginForm\ClassName.
14  */
15 abstract class PluginFormBase implements PluginFormInterface, PluginAwareInterface {
16
17   /**
18    * The plugin this form is for.
19    *
20    * @var \Drupal\Component\Plugin\PluginInspectionInterface
21    */
22   protected $plugin;
23
24   /**
25    * {@inheritdoc}
26    */
27   public function setPlugin(PluginInspectionInterface $plugin) {
28     $this->plugin = $plugin;
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
35     // Validation is optional.
36   }
37
38 }