class TestFieldConstraint

Same name 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
  2. 10 core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php \Drupal\field_test\Plugin\Validation\Constraint\TestFieldConstraint
  3. 11.x 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

Title Sort descending Modifiers Object type Summary
TestFieldConstraint::getRequiredOptions public function
TestFieldConstraint::validatedBy public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.