Sulu\Bundle\ContentBundle\Repository\NodeRepository::iterateTiers PHP Метод

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

Iterate over the ancestor tiers and build up the result.
private iterateTiers ( array $tiers, array &$result )
$tiers array
$result array (by rereference)
    private function iterateTiers($tiers, &$result)
    {
        reset($tiers);
        $uuid = key($tiers);
        $tier = array_shift($tiers);
        $found = false;
        if (is_array($result)) {
            foreach ($result as &$node) {
                if ($node['id'] === $uuid) {
                    $node['_embedded']['nodes'] = $tier;
                    $found = true;
                    break;
                }
            }
        }
        if (!$tiers) {
            return;
        }
        if (!$found) {
            throw new \RuntimeException(sprintf('Could not find target node in with UUID "%s" in tier. This should not happen.', $uuid));
        }
        $this->iterateTiers($tiers, $node['_embedded']['nodes']);
    }