public static function output(array $nodes)
	{
		$tree = '';
		$prevNode = null;
		$array = array();
		foreach ($nodes as $item) {
			
			$leftValue = $item->getLeftValue();
			
			if (isset($array[$leftValue])) {
				throw new Exception\InvalidStructure("Two nodes with equal left value '$leftValue' are found");
			}
			
			$array[$leftValue] = $item;
		}
		ksort($array);
		
		/* @var $item NodeInterface */
		foreach ($array as $item) {

			// Mark skipped tree parts with dots
			if ( ! \is_null($prevNode)) {
				$levelDiff = $item->getLevel() - $prevNode->getLevel();
				$nextLeftVal = $prevNode->getLeftValue() + 2 - $levelDiff;
				if ($item->getLeftValue() != $nextLeftVal) {
					$tree .= "...\n";
				}
			} else {
				if ($item->getLeftValue() != 1) {
					$tree .= "...\n";
				}
			}

			// Output the node
			$tree .= static::dump($item);
			$tree .= "\n";
			
			$prevNode = $item;
		}
		
		return $tree;
	}
public static function output(array $nodes)
	{
		$tree = '';
		$prevNode = null;
		$array = array();
		foreach ($nodes as $item) {
			
			$leftValue = $item->getLeftValue();
			
			if (isset($array[$leftValue])) {
				throw new Exception\InvalidStructure("Two nodes with equal left value '$leftValue' are found");
			}
			
			$array[$leftValue] = $item;
		}
		ksort($array);
		
		/* @var $item NodeInterface */
		foreach ($array as $item) {

			// Mark skipped tree parts with dots
			if ( ! \is_null($prevNode)) {
				$levelDiff = $item->getLevel() - $prevNode->getLevel();
				$nextLeftVal = $prevNode->getLeftValue() + 2 - $levelDiff;
				if ($item->getLeftValue() != $nextLeftVal) {
					$tree .= "...\n";
				}
			} else {
				if ($item->getLeftValue() != 1) {
					$tree .= "...\n";
				}
			}

			// Output the node
			$tree .= static::dump($item);
			$tree .= "\n";
			
			$prevNode = $item;
		}
		
		return $tree;
	}
public static function output ( array $ nodes ) { $ tree = '' ; $ prevNode = null ; $ array = array ( ) ; foreach ( $ nodes as $ item ) { $ leftValue = $ item -> getLeftValue ( ) ; if ( isset ( $ array [ $ leftValue ] ) ) { throw new Exception \ InvalidStructure ( "Two nodes with equal left value '$leftValue' are found" ) ; } $ array [ $ leftValue ] = $ item ; } ksort ( $ array ) ; /* @var $item NodeInterface */ foreach ( $ array as $ item ) { // Mark skipped tree parts with dots if ( ! \ is_null ( $ prevNode ) ) { $ levelDiff = $ item -> getLevel ( ) - $ prevNode -> getLevel ( ) ; $ nextLeftVal = $ prevNode -> getLeftValue ( ) + 2 - $ levelDiff ; if ( $ item -> getLeftValue ( ) != $ nextLeftVal ) { $ tree .= "...\n" ; } } else { if ( $ item -> getLeftValue ( ) != 1 ) { $ tree .= "...\n" ; } } // Output the node $ tree .= static :: dump ( $ item ) ; $ tree .= "\n" ; $ prevNode = $ item ; } return $ tree ; }
Debug output of node collection
@param array $nodes
@return string
Debug output of node collection