src/Neevo/BaseStatement.php
protected function hasCircularReferences($parent, $visited = array()){
		foreach($parent->subqueries as $child){
			if(isset($visited[spl_object_hash($child)]))
				return true;
			$visited[spl_object_hash($child)] = true;
			if($this->hasCircularReferences($child, $visited))
				return true;
			array_pop($visited);
		}
		return false;
	}
protected function hasCircularReferences($parent, $visited = array()){
		foreach($parent->subqueries as $child){
			if(isset($visited[spl_object_hash($child)]))
				return true;
			$visited[spl_object_hash($child)] = true;
			if($this->hasCircularReferences($child, $visited))
				return true;
			array_pop($visited);
		}
		return false;
	}
protected function hasCircularReferences ( $ parent , $ visited = array ( ) ) { foreach ( $ parent -> subqueries as $ child ) { if ( isset ( $ visited [ spl_object_hash ( $ child ) ] ) ) return true ; $ visited [ spl_object_hash ( $ child ) ] = true ; if ( $ this -> hasCircularReferences ( $ child , $ visited ) ) return true ; array_pop ( $ visited ) ; } return false ; }
Checks the query tree for circular references.
@param BaseStatement $parent
@param array $visited
@return bool True if circular reference found.
Checks the query tree for circular references .