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

Breadcrumb

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

class PropertyPath

Contains utility methods for dealing with property paths.

For more extensive functionality, use Symfony's PropertyAccess component.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • class \Symfony\Component\Validator\Util\PropertyPath

Expanded class hierarchy of PropertyPath

6 files declare their use of PropertyPath
ConstraintViolationBuilder.php in vendor/symfony/validator/Violation/ConstraintViolationBuilder.php
ConstraintViolationBuilder.php in core/lib/Drupal/Core/Validation/ConstraintViolationBuilder.php
ExecutionContext.php in vendor/symfony/validator/Context/ExecutionContext.php
ExecutionContext.php in core/lib/Drupal/Core/Validation/ExecutionContext.php
RecursiveContextualValidator.php in vendor/symfony/validator/Validator/RecursiveContextualValidator.php

... See full list

File

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

Namespace

Symfony\Component\Validator\Util
View source
class PropertyPath {
    
    /**
     * 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 (".").
     */
    public static function append(string $basePath, string $subPath) : string {
        if ('' !== $subPath) {
            if ('[' === $subPath[0]) {
                return $basePath . $subPath;
            }
            return '' !== $basePath ? $basePath . '.' . $subPath : $subPath;
        }
        return $basePath;
    }
    
    /**
     * Not instantiable.
     */
    private function __construct() {
    }

}

Members

Title Sort descending Modifiers Object type Summary
PropertyPath::append public static function Appends a path to a given property path.
PropertyPath::__construct private function Not instantiable.

API Navigation

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