Public Member Functions | Protected Attributes

BizDataSql Class Reference

Public Member Functions

 addMainTable ($mainTable)
 addJoinTable ($tableJoin)
 addTableColumn ($join, $column, $alias=null)
 addSqlExpression ($sqlExpr, $alias=null)
 getJoinAlias ($join)
 getTableColumn ($join, $col)
 resetSQL ()
 addSqlWhere ($sqlWhere)
 addOrderBy ($orderBy)
 addOtherSQL ($otherSQL)
 addAssociation ($assoc)
 getSqlStatement ()

Protected Attributes

 $_tableColumns = null
 $_tableJoins = null
 $_joinAliasList = array()
 $_tableAliasList = array()
 $_sqlWhere = null
 $_orderBy = null
 $_otherSQL = null
 $_aliasIndex = 0
 $_mainTable

Detailed Description

Definition at line 24 of file BizDataSql.php.


Member Function Documentation

addAssociation ( assoc )

Add association in the SQL

Parameters:
array$assocadditional SQL statment
Returns:
void

Definition at line 221 of file BizDataSql.php.

Here is the call graph for this function:

addJoinTable ( tableJoin )

Add a join table in the sql statement Ti alias

   SELECT T1.col, T2.col
   FROM table1 T1
       INNER JOIN table2 T2 ON T1.col1=T2.col1
       LEFT JOIN  table3 T3 ON T1.col1=T3.col1
   WHERE
 
Parameters:
TableJoin$tableJointable join object
Returns:
void

Definition at line 65 of file BizDataSql.php.

Here is the call graph for this function:

addMainTable ( mainTable )

Add main table in the sql statement T0 alias

Parameters:
string$mainTablemain table name
Returns:
void

Definition at line 46 of file BizDataSql.php.

addOrderBy ( orderBy )

Add order by clause

Parameters:
string$orderBySQL ORDER BY clause
Returns:
void

Definition at line 181 of file BizDataSql.php.

addOtherSQL ( otherSQL )

Add other SQL clause

Parameters:
string$otherSQLadditional SQL statment
Returns:
void

Definition at line 201 of file BizDataSql.php.

addSqlExpression ( sqlExpr,
alias = null 
)

Add SQL expression in the sql statement sqlExpr has format of "...join1.column1, ... join2.column2...". Replace join with alias

Parameters:
string$sqlExprsql expression
string$aliassql alias
Returns:
void

Definition at line 105 of file BizDataSql.php.

addSqlWhere ( sqlWhere )

Add the where clause (search rule) into the SQL statement

Parameters:
string$sqlWhereSQL WHERE clause
Returns:
void

Definition at line 161 of file BizDataSql.php.

Here is the caller graph for this function:

addTableColumn ( join,
column,
alias = null 
)

Add a join table and cloumn in the sql statement

Parameters:
string$jointable join name
string$columncolumn name
Returns:
void

Definition at line 87 of file BizDataSql.php.

Here is the call graph for this function:

getJoinAlias ( join )

Get join table alias

Parameters:
string$joinname of join
Returns:
string join table alias

Definition at line 121 of file BizDataSql.php.

Here is the caller graph for this function:

getSqlStatement (  )

Get the SQL statement

Returns:
string SQL statement

Definition at line 285 of file BizDataSql.php.

getTableColumn ( join,
col 
)

Get table column, combine a table with a column.

Parameters:
string$joinjoin name
string$colcolumn
Returns:
string table column combination string

Definition at line 136 of file BizDataSql.php.

Here is the call graph for this function:

Here is the caller graph for this function:

resetSQL (  )

Reset SQL to be empty

Returns:
avoid

Definition at line 148 of file BizDataSql.php.


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