You are here

interface InputInterface in Open Social 10.0.x

Same name and namespace in other branches
  1. 10.3.x modules/custom/social_graphql/src/Wrappers/InputInterface.php \Drupal\social_graphql\Wrappers\InputInterface
  2. 10.1.x modules/custom/social_graphql/src/Wrappers/InputInterface.php \Drupal\social_graphql\Wrappers\InputInterface
  3. 10.2.x modules/custom/social_graphql/src/Wrappers/InputInterface.php \Drupal\social_graphql\Wrappers\InputInterface

Provides an interface for input types.

Hierarchy

Expanded class hierarchy of InputInterface

All classes that implement InputInterface

File

modules/custom/social_graphql/src/Wrappers/InputInterface.php, line 10

Namespace

Drupal\social_graphql\Wrappers
View source
interface InputInterface {

  /**
   * Set the values for this input.
   *
   * @param array $input
   *   The input array as it comes from the GraphQL schema.
   */
  public function setValues(array $input) : void;

  /**
   * Validates the input.
   *
   * Must be called after setValues but before any data is accessed.
   *
   * @return bool
   *   Whether the validation was successful.
   */
  public function validate() : bool;

  /**
   * Whether this input has any violations.
   *
   * @return bool
   *   Whether this input has any violations.
   */
  public function hasViolations() : bool;

  /**
   * Get the violations on this input.
   *
   * @return \Drupal\social_graphql\GraphQL\ViolationInterface[]
   *   An array of violations that were detected during validation or an empty
   *   array if there are no violations.
   */
  public function getViolations() : array;

}

Members

Namesort descending Modifiers Type Description Overrides
InputInterface::getViolations public function Get the violations on this input.
InputInterface::hasViolations public function Whether this input has any violations.
InputInterface::setValues public function Set the values for this input.
InputInterface::validate public function Validates the input.