XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
DBParser Class Reference

Public Member Functions

 __construct ($escape_char_left, $escape_char_right="", $table_prefix="xe_")
 
 getEscapeChar ($leftOrRight)
 
 escape ($name)
 
 escapeString ($name)
 
 escapeStringValue ($value)
 
 parseTableName ($name)
 
 parseColumnName ($name)
 
 escapeColumn ($column_name)
 
 isUnqualifiedColumnName ($column_name)
 
 isQualifiedColumnName ($column_name)
 
 parseExpression ($column_name)
 
 isStar ($column_name)
 
 isStarFunction ($column_name)
 
 escapeColumnExpression ($column_name)
 

Public Attributes

 $escape_char_left
 
 $escape_char_right
 
 $table_prefix
 

Detailed Description

Definition at line 17 of file DBParser.class.php.

Constructor & Destructor Documentation

DBParser::__construct (   $escape_char_left,
  $escape_char_right = "",
  $table_prefix = "xe_" 
)

Constructor

Parameters
string$escape_char_left
string$escape_char_right
string$table_prefix
Returns
void

Definition at line 63 of file DBParser.class.php.

Member Function Documentation

DBParser::escape (   $name)

Escape the value

Parameters
mixed$name
Returns
string

Definition at line 101 of file DBParser.class.php.

DBParser::escapeColumn (   $column_name)

Escape column name

Parameters
string$column_name
Returns
string column name with db name

Definition at line 166 of file DBParser.class.php.

DBParser::escapeColumnExpression (   $column_name)

Return column name after escape

Parameters
string$column_name
Returns
string

Definition at line 314 of file DBParser.class.php.

DBParser::escapeString (   $name)

Escape the string value

Parameters
string$name
Returns
string

Definition at line 112 of file DBParser.class.php.

DBParser::escapeStringValue (   $value)

Escape the string value

Parameters
string$value
Returns
string

Definition at line 123 of file DBParser.class.php.

DBParser::getEscapeChar (   $leftOrRight)

Get escape character

Parameters
string$leftOrRightleft or right
Returns
string

Definition at line 83 of file DBParser.class.php.

DBParser::isQualifiedColumnName (   $column_name)

Checks to see if a given column name is qualified

Ex: "member_srl" -> unqualified
"member"."member_srl" -> qualified

Parameters
string$column_name
Returns
bool

Definition at line 208 of file DBParser.class.php.

DBParser::isStar (   $column_name)

Checks if a given argument is an asterisk

Parameters
string$column_name
Returns
bool

Definition at line 284 of file DBParser.class.php.

DBParser::isStarFunction (   $column_name)

Checks to see if expression is an aggregate star function like count(*)

Parameters
string$column_name
Returns
bool

Definition at line 300 of file DBParser.class.php.

DBParser::isUnqualifiedColumnName (   $column_name)

Checks to see if a given column name is unqualified

Ex: "member_srl" -> unqualified
"member"."member_srl" -> qualified

Parameters
string$column_name
Returns
bool

Definition at line 190 of file DBParser.class.php.

DBParser::parseColumnName (   $name)

Return column name after escape

Parameters
string$namecolumn name before escape
Returns
string column name after escape

Definition at line 155 of file DBParser.class.php.

DBParser::parseExpression (   $column_name)

Escapes a query expression

An expression can be:

  • a column name: "member_srl" or "xe_member"."member_srl"
  • an expression:
    • LEFT(UPPER("content"))
    • readed_count + voted_count
    • CAST(regdate as DATE)
Parameters
$column_name
Returns
string

Definition at line 235 of file DBParser.class.php.

DBParser::parseTableName (   $name)

Return table full name

Parameters
string$nametable name without table prefix
Returns
string table full name with table prefix

Definition at line 143 of file DBParser.class.php.

Member Data Documentation

DBParser::$escape_char_left

Definition at line 31 of file DBParser.class.php.

DBParser::$escape_char_right

Definition at line 43 of file DBParser.class.php.

DBParser::$table_prefix

Definition at line 52 of file DBParser.class.php.


The documentation for this class was generated from the following file: