Puli\Repository\JsonRepository::initWithParentOrder PHP Метод

initWithParentOrder() приватный Метод

Initializes a path with the order of the closest parent path.
private initWithParentOrder ( string $path, array $parentReferences )
$path string The path to initialize.
$parentReferences array The defined references for parent paths, with long paths /a/b sorted before short paths /a.
    private function initWithParentOrder($path, array $parentReferences)
    {
        foreach ($parentReferences as $parentPath => $_) {
            // Look for the first parent entry for which an order is defined
            if (isset($this->json['_order'][$parentPath])) {
                // Inherit that order
                $this->json['_order'][$path] = $this->json['_order'][$parentPath];
                return;
            }
        }
    }