You are here

class TestFieldConstraint in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php \Drupal\field_test\Plugin\Validation\Constraint\TestFieldConstraint

Checks if a value is not equal.

Plugin annotation


@Constraint(
  id = "TestField",
  label = @Translation("Test Field", context = "Validation"),
  type = { "integer" }
)

Hierarchy

  • class \Drupal\field_test\Plugin\Validation\Constraint\TestFieldConstraint extends \Symfony\Component\Validator\Constraints\NotEqualTo

Expanded class hierarchy of TestFieldConstraint

File

core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php, line 16

Namespace

Drupal\field_test\Plugin\Validation\Constraint
View source
class TestFieldConstraint extends NotEqualTo {

  /**
   * {@inheritdoc}
   */
  public function getRequiredOptions() {
    return [
      'value',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function validatedBy() {
    return '\\Symfony\\Component\\Validator\\Constraints\\NotEqualToValidator';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TestFieldConstraint::getRequiredOptions public function Returns the name of the required options.
TestFieldConstraint::validatedBy public function Returns the name of the class that validates this constraint.