Neos\ContentRepository\Domain\Repository\NodeDataRepository::findNextFreeIndexInParentPath PHP Метод

findNextFreeIndexInParentPath() защищенный Метод

Finds the next free index on the level below the given parent path across all workspaces.
protected findNextFreeIndexInParentPath ( string $parentPath ) : integer
$parentPath string Path of the parent node specifying the level in the node tree
Результат integer The next available index
    protected function findNextFreeIndexInParentPath($parentPath)
    {
        if (!isset($this->highestIndexCache[$parentPath])) {
            /** @var \Doctrine\ORM\Query $query */
            $query = $this->entityManager->createQuery('SELECT MAX(n.index) FROM Neos\\ContentRepository\\Domain\\Model\\NodeData n WHERE n.parentPathHash = :parentPathHash');
            $query->setParameter('parentPathHash', md5($parentPath));
            $this->highestIndexCache[$parentPath] = $query->getSingleScalarResult() ?: 0;
        }
        $this->highestIndexCache[$parentPath] += 100;
        return $this->highestIndexCache[$parentPath];
    }