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

Breadcrumb

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

function ClassMetadata::addGetterMethodConstraint

Adds a constraint to the getter of the given property.

Return value

$this

1 call to ClassMetadata::addGetterMethodConstraint()
ClassMetadata::addGetterMethodConstraints in vendor/symfony/validator/Mapping/ClassMetadata.php

File

vendor/symfony/validator/Mapping/ClassMetadata.php, line 279

Class

ClassMetadata
Default implementation of {@link ClassMetadataInterface}.

Namespace

Symfony\Component\Validator\Mapping

Code

public function addGetterMethodConstraint(string $property, string $method, Constraint $constraint) : static {
    if (!isset($this->getters[$property])) {
        $this->getters[$property] = new GetterMetadata($this->getClassName(), $property, $method);
        $this->addPropertyMetadata($this->getters[$property]);
    }
    $constraint->addImplicitGroupName($this->getDefaultGroup());
    $this->getters[$property]
        ->addConstraint($constraint);
    return $this;
}

API Navigation

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