3 namespace Drupal\entity_browser;
5 use Drupal\Component\Plugin\ConfigurablePluginInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
10 * Defines the interface for entity browser widget validations.
12 interface WidgetValidationInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
15 * Returns the widget validation label.
18 * The widget validation label.
20 public function label();
23 * Validates the widget.
25 * @param array $entities
26 * Array of selected entities.
27 * @param array $options
28 * (Optional) Array of options needed by the constraint validator.
30 * @return \Symfony\Component\Validator\ConstraintViolationListInterface
31 * A list of constraint violations. If the list is empty, validation
34 public function validate(array $entities, $options = []);