Method | Description | |
---|---|---|
__construct ( $p_indent ) | Class constructor | |
addColumn ( string $p_column ) : void | Adds a column to be fetched by the query. | |
addConditionalWhere ( string $p_condition ) : void | Adds a conditional WHERE condition to the query (using 'OR' operator) | |
addGroupField ( $p_field ) | Add group field | |
addHaving ( $p_condition ) | Add HAVING condition | |
addJoin ( string $p_join ) : void | Adds a table join to the query. | |
addOrderBy ( string $p_order ) : void | Adds an ORDER BY condition to the query. | |
addTableFrom ( string $p_table ) : void | Adds a table to the FROM part of the query. | |
addWhere ( string $p_condition ) : void | Adds a WHERE condition to the query. | |
buildQuery ( ) : string | Builds the SQL query from the object attributes. | |
setDistinct ( string $p_column = null ) : void | Sets all or specific column(s) to be fetched DISTINCT. | |
setLimit ( integer $p_start, integer $p_offset ) : void | Sets the LIMIT of the query. | |
setTable ( string $p_table ) : void | Sets the name of the main table in the query. |
Method | Description | |
---|---|---|
buildColumns ( ) : string | Builds the list of columns to be retrieved by the query. | |
buildFrom ( ) : string | Builds the FORM part of the query based on the main table and whether there is some table to join with. | |
buildGroupBy ( ) : string | Builds the GROUP BY clause. | |
buildHaving ( ) : string | Builds the HAVING clause. | |
buildOrderBy ( ) : string | Builds the ORDER BY conditions. | |
buildWhere ( ) : string | Builds the list of WHERE conditions. | |
hasFrom ( ) : boolean | Returns whether there is FROM tables other than the main query table. | |
hasJoins ( ) : boolean | Returns whether there is table joins. | |
indent ( $p_inner ) : string | Returns the indentation string |
public addConditionalWhere ( string $p_condition ) : void | ||
$p_condition | string | The comparison operation |
return | void |
public addOrderBy ( string $p_order ) : void | ||
$p_order | string | The column and the direction of the order condition |
return | void |
public addTableFrom ( string $p_table ) : void | ||
$p_table | string | The name of the table |
return | void |
public buildQuery ( ) : string | ||
return | string | $sql The full SQL query |
public setDistinct ( string $p_column = null ) : void | ||
$p_column | string | The column which have to fetched distinct |
return | void |