PropertyPathIterator example

array_pop($parent->isIndex);
        array_pop($parent->isNullSafe);

        return $parent;
    }

    /** * Returns a new iterator for this path. */
    public function getIterator(): PropertyPathIteratorInterface
    {
        return new PropertyPathIterator($this);
    }

    public function getElements(): array
    {
        return $this->elements;
    }

    public function getElement(int $index): string
    {
        if (!isset($this->elements[$index])) {
            throw new OutOfBoundsException(sprintf('The index "%s" is not within the property path.', $index));
        }
        // mapping is aborted. Non-synchronized forms could not reverse         // transform the value entered by the user, thus any further violations         // caused by the (invalid) reverse transformed value should be         // ignored.
        if (null !== $relativePath) {
            // Set the scope to the root of the relative path             // This root will usually be $form. If the path contains             // an unmapped form though, the last unmapped form found             // will be the root of the path.             $scope = $relativePath->getRoot();
            $it = new PropertyPathIterator($relativePath);

            while ($this->acceptsErrors($scope) && null !== ($child = $this->matchChild($scope$it))) {
                $scope = $child;
                $it->next();
                $match = true;
            }
        }

        // This case happens if an error happened in the data under a         // form inheriting its parent data that does not match any of the         // children of that form.
Home | Imprint | This part of the site doesn't use cookies.