Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldConfigBase.php

function FieldConfigBase::addPropertyConstraints

Overrides FieldConfigInterface::addPropertyConstraints

File

core/lib/Drupal/Core/Field/FieldConfigBase.php, line 613

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

public function addPropertyConstraints($name, array $constraints) {
    foreach ($constraints as $constraint_name => $options) {
        $this->propertyConstraints[$name][$constraint_name] = $options;
    }
    // Reset the field item definition so the next time it is instantiated it
    // will receive the new constraints.
    $this->itemDefinition = NULL;
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal