5 * Contains \Drupal\filefield_sources\FilefieldSourceInterface.
8 namespace Drupal\filefield_sources;
10 use Drupal\Core\Form\FormStateInterface;
13 * Provides an interface for file field source plugins.
15 * @see \Drupal\filefield_sources\FilefieldSourceManager
16 * @see \Drupal\filefield_sources\Annotation\FilefieldSource
19 * @ingroup filefield_sources
21 interface FilefieldSourceInterface {
24 * Value callback for file field source plugin.
26 * @param array $element
27 * An associative array containing the properties of the element.
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.
35 * The value to assign to the element.
37 public static function value(array &$element, &$input, FormStateInterface $form_state);
40 * Process callback for file field source plugin.
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.
51 * The processed element.
53 public static function process(array &$element, FormStateInterface $form_state, array &$complete_form);