TestFieldConstraint.php

Same filename in other branches
  1. 9 core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php
  2. 8.9.x core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php
  3. 10 core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php

Namespace

Drupal\field_test\Plugin\Validation\Constraint

File

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

View source
<?php

declare (strict_types=1);
namespace Drupal\field_test\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraints\NotEqualTo;

/**
 * Checks if a value is not equal.
 */
class TestFieldConstraint extends NotEqualTo {
    
    /**
     * {@inheritdoc}
     */
    public function getRequiredOptions() : array {
        return [
            'value',
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function validatedBy() : string {
        return '\\Symfony\\Component\\Validator\\Constraints\\NotEqualToValidator';
    }

}

Classes

Title Deprecated Summary
TestFieldConstraint Checks if a value is not equal.

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