You are here

class FieldValidationConstraint in Field Validation 8

Checks that the node.

Plugin annotation


@Constraint(
  id = "FieldValidationConstraint",
  label = @Translation("Field Validation Constraint"),
)

Hierarchy

  • class \Drupal\field_validation\Plugin\Validation\Constraint\FieldValidationConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of FieldValidationConstraint

1 file declares its use of FieldValidationConstraint
FieldValidationRuleBase.php in tests/src/Kernel/Plugin/FieldValidationRule/FieldValidationRuleBase.php
15 string references to 'FieldValidationConstraint'
BlackListFieldValidationRuleTest::setUp in tests/src/Kernel/Plugin/FieldValidationRule/BlackListFieldValidationRuleTest.php
DateRangeFieldValidationRuleTest::setUp in tests/src/Kernel/Plugin/FieldValidationRule/DateRangeFieldValidationRuleTest.php
EmailFieldValidationRuleTest::setUp in tests/src/Kernel/Plugin/FieldValidationRule/EmailFieldValidationRuleTest.php
field_validation_entity_base_field_info_alter in ./field_validation.module
Implements hook_entity_base_field_info_alter().
field_validation_entity_bundle_field_info_alter in ./field_validation.module
@file field validation.

... See full list

File

src/Plugin/Validation/Constraint/FieldValidationConstraint.php, line 16

Namespace

Drupal\field_validation\Plugin\Validation\Constraint
View source
class FieldValidationConstraint extends Constraint {
  public $ruleset_name;
  public $rule_uuid;
  public function __construct($options = null) {
    if (is_array($options)) {
      if (key_exists('ruleset_name', $options)) {
        $this->ruleset_name = $options['ruleset_name'];
      }
      if (key_exists('rule_uuid', $options)) {
        $this->rule_uuid = $options['rule_uuid'];
      }
    }
    if (null !== $options && !is_array($options)) {
      $options = [
        'ruleset_name' => $options,
        'rule_uuid' => $options,
      ];
    }
    parent::__construct($options);
  }

}

Members