public function searchNodes( MW_Common_Criteria_Interface $search, $id = null )
	{
		$left =  1;
		$right = 0x7FFFFFFF;

		if( $id !== null )
		{
			$node = $this->_getNodeById( $id );

			$left =  $node->left;
			$right = $node->right;
		}

		$types = $this->_getSearchTypes( $this->_searchConfig );
		$translations = $this->_getSearchTranslations( $this->_searchConfig );
		$conditions = $search->getConditionString( $types, $translations );
		$sortations = $search->getSortationString( $types, $translations );

		$sql = str_replace(
			array( ':cond', ':order' ),
			array( $conditions, $sortations ),
			$this->_config['search']
		);

		$conn = $this->_dbm->acquire( $this->_dbname );

		try
		{
			$stmt = $conn->create( $sql );
			$stmt->bind( 1, $left, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, $right, MW_DB_Statement_Abstract::PARAM_INT );
			$result = $stmt->execute();

			try
			{
				$nodes = array();
				while( ( $row = $result->fetch() ) !== false ) {
					$nodes[$row['id']] = $this->_createNode( $row );
				}
			}
			catch( Exception $e )
			{
				$result->finish();
				throw $e;
			}

			$this->_dbm->release( $conn, $this->_dbname );
		}
		catch( Exception $e )
		{
			$this->_dbm->release( $conn, $this->_dbname );
			throw $e;
		}

		return $nodes;
	}
public function searchNodes( MW_Common_Criteria_Interface $search, $id = null )
	{
		$left =  1;
		$right = 0x7FFFFFFF;

		if( $id !== null )
		{
			$node = $this->_getNodeById( $id );

			$left =  $node->left;
			$right = $node->right;
		}

		$types = $this->_getSearchTypes( $this->_searchConfig );
		$translations = $this->_getSearchTranslations( $this->_searchConfig );
		$conditions = $search->getConditionString( $types, $translations );
		$sortations = $search->getSortationString( $types, $translations );

		$sql = str_replace(
			array( ':cond', ':order' ),
			array( $conditions, $sortations ),
			$this->_config['search']
		);

		$conn = $this->_dbm->acquire( $this->_dbname );

		try
		{
			$stmt = $conn->create( $sql );
			$stmt->bind( 1, $left, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, $right, MW_DB_Statement_Abstract::PARAM_INT );
			$result = $stmt->execute();

			try
			{
				$nodes = array();
				while( ( $row = $result->fetch() ) !== false ) {
					$nodes[$row['id']] = $this->_createNode( $row );
				}
			}
			catch( Exception $e )
			{
				$result->finish();
				throw $e;
			}

			$this->_dbm->release( $conn, $this->_dbname );
		}
		catch( Exception $e )
		{
			$this->_dbm->release( $conn, $this->_dbname );
			throw $e;
		}

		return $nodes;
	}
public function searchNodes ( MW_Common_Criteria_Interface $ search , $ id = null ) { $ left = 1 ; $ right = 0x7FFFFFFF ; if ( $ id !== null ) { $ node = $ this -> _getNodeById ( $ id ) ; $ left = $ node -> left ; $ right = $ node -> right ; } $ types = $ this -> _getSearchTypes ( $ this -> _searchConfig ) ; $ translations = $ this -> _getSearchTranslations ( $ this -> _searchConfig ) ; $ conditions = $ search -> getConditionString ( $ types , $ translations ) ; $ sortations = $ search -> getSortationString ( $ types , $ translations ) ; $ sql = str_replace ( array ( ':cond' , ':order' ) , array ( $ conditions , $ sortations ) , $ this -> _config [ 'search' ] ) ; $ conn = $ this -> _dbm -> acquire ( $ this -> _dbname ) ; try { $ stmt = $ conn -> create ( $ sql ) ; $ stmt -> bind ( 1 , $ left , MW_DB_Statement_Abstract :: PARAM_INT ) ; $ stmt -> bind ( 2 , $ right , MW_DB_Statement_Abstract :: PARAM_INT ) ; $ result = $ stmt -> execute ( ) ; try { $ nodes = array ( ) ; while ( ( $ row = $ result -> fetch ( ) ) !== false ) { $ nodes [ $ row [ 'id' ] ] = $ this -> _createNode ( $ row ) ; } } catch ( Exception $ e ) { $ result -> finish ( ) ; throw $ e ; } $ this -> _dbm -> release ( $ conn , $ this -> _dbname ) ; } catch ( Exception $ e ) { $ this -> _dbm -> release ( $ conn , $ this -> _dbname ) ; throw $ e ; } return $ nodes ; }
Retrieves a list of nodes from the storage matching the given search criteria.

@param MW_Common_Criteria_Interface $search Search criteria object
@param integer|null $id Search nodes starting at the node with the given ID
@return array List of nodes implementing MW_Tree_Node_Interface
Retrieves a list of nodes from the storage matching the given search criteria .