lib/SQLBuilder.php
public static function createHashFromUnderscoredString($name, &$values=array(), &$map=null)
	{
		throw new \Exception("This should be refactored!!!", 1);
	
		$parts = preg_split('/(_and_|_or_)/i',$name);
		$hash = array();

		for ($i=0,$n=count($parts); $i<$n; ++$i)
		{
			// map to correct name if $map was supplied
			$name = $map && isset($map[$parts[$i]]) ? $map[$parts[$i]] : $parts[$i];
			$hash[$name] = $values[$i];
		}
		return $hash;
	}
public static function createHashFromUnderscoredString($name, &$values=array(), &$map=null)
	{
		throw new \Exception("This should be refactored!!!", 1);
	
		$parts = preg_split('/(_and_|_or_)/i',$name);
		$hash = array();

		for ($i=0,$n=count($parts); $i<$n; ++$i)
		{
			// map to correct name if $map was supplied
			$name = $map && isset($map[$parts[$i]]) ? $map[$parts[$i]] : $parts[$i];
			$hash[$name] = $values[$i];
		}
		return $hash;
	}
public static function createHashFromUnderscoredString ( $ name , & $ values = array ( ) , & $ map = null ) { throw new \ Exception ( "This should be refactored!!!" , 1 ) ; $ parts = preg_split ( '/(_and_|_or_)/i' , $ name ) ; $ hash = array ( ) ; for ( $ i = 0 , $ n = count ( $ parts ) ; $ i < $ n ; ++ $ i ) { // map to correct name if $map was supplied $ name = $ map && isset ( $ map [ $ parts [ $ i ] ] ) ? $ map [ $ parts [ $ i ] ] : $ parts [ $ i ] ; $ hash [ $ name ] = $ values [ $ i ] ; } return $ hash ; }
Like create_conditions_from_underscored_string but returns a hash of name => value array instead.

@param string $name A string containing attribute names connected with _and_ or _or_
@param $args Array of values for each attribute in $name
@param $map A hash of "mapped_column_name" => "real_column_name"
@return array A hash of array(name => value, ...)
Like create_conditions_from_underscored_string but returns a hash of name = > value array instead .