Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Menu / Form / MenuLinkFormInterface.php
1 <?php
2
3 namespace Drupal\Core\Menu\Form;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\Core\Menu\MenuLinkInterface;
7 use Drupal\Core\Plugin\PluginFormInterface;
8
9 /**
10  * Defines an interface for edit forms of menu links.
11  *
12  * All menu link plugins use the same interface for their configuration or
13  * editing form, but the implementations may differ.
14  *
15  * @see \Drupal\Core\Menu\MenuLinkInterface::getFormClass()
16  */
17 interface MenuLinkFormInterface extends PluginFormInterface {
18
19   /**
20    * Injects the menu link plugin instance.
21    *
22    * @param \Drupal\Core\Menu\MenuLinkInterface $menu_link
23    *   A menu link plugin instance.
24    */
25   public function setMenuLinkInstance(MenuLinkInterface $menu_link);
26
27   /**
28    * Extracts a plugin definition from form values.
29    *
30    * @param array $form
31    *   An associative array containing the structure of the form.
32    * @param \Drupal\Core\Form\FormStateInterface $form_state
33    *   The current state of the form.
34    *
35    * @return array
36    *   The new plugin definition values taken from the form values. The plugin
37    *   ID must be returned as part of the definition.
38    */
39   public function extractFormValues(array &$form, FormStateInterface $form_state);
40
41 }