public function quoteName($name, $as = null)
	{
		$parts = (strpos($name, '.') !== false) ? explode('.', $name) : (array)$name;
		$bits  = array();

		foreach ($parts as $part)
		{
			$bits[] = sprintf($this->wrapper, $part);
		}

		// Put back together and add 'AS' clause
		$string  = implode('.', $bits);
		$string .= (isset($as)) ? ' AS ' . sprintf($this->wrapper, $as) : '';

		return $string;
	}
public function quoteName($name, $as = null)
	{
		$parts = (strpos($name, '.') !== false) ? explode('.', $name) : (array)$name;
		$bits  = array();

		foreach ($parts as $part)
		{
			$bits[] = sprintf($this->wrapper, $part);
		}

		// Put back together and add 'AS' clause
		$string  = implode('.', $bits);
		$string .= (isset($as)) ? ' AS ' . sprintf($this->wrapper, $as) : '';

		return $string;
	}
public function quoteName ( $ name , $ as = null ) { $ parts = ( strpos ( $ name , '.' ) !== false ) ? explode ( '.' , $ name ) : ( array ) $ name ; $ bits = array ( ) ; foreach ( $ parts as $ part ) { $ bits [ ] = sprintf ( $ this -> wrapper , $ part ) ; } // Put back together and add 'AS' clause $ string = implode ( '.' , $ bits ) ; $ string .= ( isset ( $ as ) ) ? ' AS ' . sprintf ( $ this -> wrapper , $ as ) : '' ; return $ string ; }
Wraps an SQL statement identifier name such as column, table or database names
in quotes to prevent injection risks and reserved word conflicts

@param   string  $name  The identifier name to wrap in quotes, supporting dot-notation names
@param   string  $as    The AS query part associated to $name
@return  string
@since   2.0.0
Wraps an SQL statement identifier name such as column table or database names in quotes to prevent injection risks and reserved word conflicts