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

Breadcrumb

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

function PropertyPath::append

Appends a path to a given property path.

If the base path is empty, the appended path will be returned unchanged. If the base path is not empty, and the appended path starts with a squared opening bracket ("["), the concatenation of the two paths is returned. Otherwise, the concatenation of the two paths is returned, separated by a dot (".").

8 calls to PropertyPath::append()
ConstraintViolationBuilder::atPath in vendor/symfony/validator/Violation/ConstraintViolationBuilder.php
Stores the property path at which the violation should be generated.
ConstraintViolationBuilder::atPath in core/lib/Drupal/Core/Validation/ConstraintViolationBuilder.php
Stores the property path at which the violation should be generated.
ExecutionContext::getPropertyPath in vendor/symfony/validator/Context/ExecutionContext.php
Returns the property path to the value that the validator is currently validating.
ExecutionContext::getPropertyPath in core/lib/Drupal/Core/Validation/ExecutionContext.php
Returns the property path to the value that the validator is currently validating.
RecursiveContextualValidator::validateClassNode in vendor/symfony/validator/Validator/RecursiveContextualValidator.php
Validates a class node.

... See full list

File

vendor/symfony/validator/Util/PropertyPath.php, line 32

Class

PropertyPath
Contains utility methods for dealing with property paths.

Namespace

Symfony\Component\Validator\Util

Code

public static function append(string $basePath, string $subPath) : string {
    if ('' !== $subPath) {
        if ('[' === $subPath[0]) {
            return $basePath . $subPath;
        }
        return '' !== $basePath ? $basePath . '.' . $subPath : $subPath;
    }
    return $basePath;
}

API Navigation

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