Interim commit.
[yaffs-website] / web / modules / contrib / entity_browser / src / WidgetValidationInterface.php
1 <?php
2
3 namespace Drupal\entity_browser;
4
5 use Drupal\Component\Plugin\ConfigurablePluginInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7
8
9 /**
10  * Defines the interface for entity browser widget validations.
11  */
12 interface WidgetValidationInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
13
14   /**
15    * Returns the widget validation label.
16    *
17    * @return string
18    *   The widget validation label.
19    */
20   public function label();
21
22   /**
23    * Validates the widget.
24    *
25    * @param array $entities
26    *   Array of selected entities.
27    * @param array $options
28    *   (Optional) Array of options needed by the constraint validator.
29    *
30    * @return \Symfony\Component\Validator\ConstraintViolationListInterface
31    *   A list of constraint violations. If the list is empty, validation
32    *   succeeded.
33    */
34   public function validate(array $entities, $options = []);
35 }