Further modules included.
[yaffs-website] / web / modules / contrib / filefield_sources / src / FilefieldSourceInterface.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\filefield_sources\FilefieldSourceInterface.
6  */
7
8 namespace Drupal\filefield_sources;
9
10 use Drupal\Core\Form\FormStateInterface;
11
12 /**
13  * Provides an interface for file field source plugins.
14  *
15  * @see \Drupal\filefield_sources\FilefieldSourceManager
16  * @see \Drupal\filefield_sources\Annotation\FilefieldSource
17  * @see plugin_api
18  *
19  * @ingroup filefield_sources
20  */
21 interface FilefieldSourceInterface {
22
23   /**
24    * Value callback for file field source plugin.
25    *
26    * @param array $element
27    *   An associative array containing the properties of the element.
28    * @param mixed $input
29    *   The incoming input to populate the form element. If this is FALSE,
30    *   the element's default value should be returned.
31    * @param \Drupal\Core\Form\FormStateInterface $form_state
32    *   The current state of the form.
33    *
34    * @return mixed
35    *   The value to assign to the element.
36    */
37   public static function value(array &$element, &$input, FormStateInterface $form_state);
38
39   /**
40    * Process callback for file field source plugin.
41    *
42    * @param array $element
43    *   An associative array containing the properties and children of the
44    *   generic input element.
45    * @param \Drupal\Core\Form\FormStateInterface $form_state
46    *   The current state of the form.
47    * @param array $complete_form
48    *   The complete form structure.
49    *
50    * @return array
51    *   The processed element.
52    */
53   public static function process(array &$element, FormStateInterface $form_state, array &$complete_form);
54
55 }