phpDocumentor openbiz.bin.data
[ class tree: openbiz.bin.data ] [ index: openbiz.bin.data ] [ all elements ]

Class: BizDataSql

Source Location: /data/BizDataSql.php

Class BizDataSql

Property Summary
mixed   $_aliasIndex  
mixed   $_joinAliasList  
mixed   $_mainTable  
mixed   $_orderBy  
mixed   $_otherSQL  
mixed   $_sqlWhere  
mixed   $_tableAliasList  
mixed   $_tableColumns  
mixed   $_tableJoins  

[ Top ]
Method Summary
BizDataSql   __construct()  
void   AddAssociation()   Add association in the SQL
void   AddJoinTable()   Add a join table in the sql statement Ti alias
void   AddMainTable()   Add main table in the sql statement T0 alias
void   AddOrderBy()   Add order by clause
void   AddOtherSQL()   Add other SQL clause
void   AddSqlExpression()   Add SQL expression in the sql statement sqlExpr has format of "...join1.column1, ... join2.column2...". Replace join with alias
void   AddSqlWhere()   Add the where clause (search rule) into the SQL statement
void   AddTableColumn()   Add a join table and cloumn in the sql statement
string   GetJoinAlias()   Get join table alias
SQL   GetSqlStatement()   Get the SQL statement
string   GetTableColumn()   Get table column, combine a table with a column.
avoid   ResetSQL()   Reset SQL to be empty

[ Top ]
Properties
mixed   $_aliasIndex = 0 [line 33]
API Tags:
Access:  protected


[ Top ]
mixed   $_joinAliasList = array() [line 28]
API Tags:
Access:  protected


[ Top ]
mixed   $_mainTable [line 34]
API Tags:
Access:  protected


[ Top ]
mixed   $_orderBy = null [line 31]
API Tags:
Access:  protected


[ Top ]
mixed   $_otherSQL = null [line 32]
API Tags:
Access:  protected


[ Top ]
mixed   $_sqlWhere = null [line 30]
API Tags:
Access:  protected


[ Top ]
mixed   $_tableAliasList = array() [line 29]
API Tags:
Access:  protected


[ Top ]
mixed   $_tableColumns = null [line 26]
API Tags:
Access:  protected


[ Top ]
mixed   $_tableJoins = null [line 27]
API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 36]

  BizDataSql __construct( )


API Tags:
Access:  public


[ Top ]
AddAssociation  [line 219]

  void AddAssociation( array $assc  )

Add association in the SQL

Parameters:
array   $assc:  additional SQL statment

API Tags:
Access:  public


[ Top ]
AddJoinTable  [line 64]

  void AddJoinTable( TableJoin $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   $tableJoin:  table join object

API Tags:
Access:  public


[ Top ]
AddMainTable  [line 46]

  void AddMainTable( string $mainTable  )

Add main table in the sql statement T0 alias

Parameters:
string   $mainTable:  main table name

API Tags:
Access:  public


[ Top ]
AddOrderBy  [line 179]

  void AddOrderBy( string $orderBy  )

Add order by clause

Parameters:
string   $orderBy:  SQL ORDER BY clause

API Tags:
Access:  public


[ Top ]
AddOtherSQL  [line 199]

  void AddOtherSQL( string $otherSQL  )

Add other SQL clause

Parameters:
string   $otherSQL:  additional SQL statment

API Tags:
Access:  public


[ Top ]
AddSqlExpression  [line 103]

  void AddSqlExpression( string $sqlExpr, [string $alias = null]  )

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

Parameters:
string   $sqlExpr:  sql expression
string   $alias:  sql alias

API Tags:
Access:  public


[ Top ]
AddSqlWhere  [line 159]

  void AddSqlWhere( string $sqlWhere  )

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

Parameters:
string   $sqlWhere:  SQL WHERE clause

API Tags:
Access:  public


[ Top ]
AddTableColumn  [line 86]

  void AddTableColumn( string $join, string $column  )

Add a join table and cloumn in the sql statement

Parameters:
string   $join:  table join name
string   $column:  column name

API Tags:
Access:  public


[ Top ]
GetJoinAlias  [line 119]

  string GetJoinAlias( string $join  )

Get join table alias

Parameters:
string   $join:  name of join

API Tags:
Return:  join table alias
Access:  public


[ Top ]
GetSqlStatement  [line 263]

  SQL GetSqlStatement( )

Get the SQL statement


API Tags:
Return:  statement string
Access:  public


[ Top ]
GetTableColumn  [line 134]

  string GetTableColumn( string $join, string $col  )

Get table column, combine a table with a column.

Parameters:
string   $join:  join name
string   $col:  column

API Tags:
Return:  table column combination string
Access:  public


[ Top ]
ResetSQL  [line 146]

  avoid ResetSQL( )

Reset SQL to be empty


API Tags:
Access:  public


[ Top ]

Documentation generated on Tue, 22 Dec 2009 03:02:36 -0800 by phpDocumentor 1.3.0RC3