libAllure
 
Loading...
Searching...
No Matches
libAllure\QueryBuilder Class Reference

Public Member Functions

 __construct ($verb='SELECT')
 
 build ()
 
 buildGroup ()
 
 buildJoinConditions ($joinedTable)
 
 buildJoins ()
 
 buildTableAlias ($tbl, $alias, $database)
 
 fields (string|array ... $fields)
 
 from (string $tableName, string $alias=null, string $database=null)
 
 group ($field)
 
 groupBy ($field)
 
 join ($tbl, $alias=null, $database=null)
 
 joinedTable ($tbl=null)
 
 joinImpl ($direction, $tbl, $alias=null, $database=null)
 
 leftJoin ($tbl, $alias=null, $database=null)
 
 on (string $field, string $operator, string $value)
 
 onEq ($field, $value)
 
 onFromFieldsEq ($fromField, $joinedField)
 
 onGt ($field, $value)
 
 orderBy (string ... $fields)
 
 where ($field, $operator, $value)
 
 whereEquals ($field, $value)
 
 whereEqualsParam ($field, $value)
 
 whereEqualsValue ($field, $value)
 
 whereGt ($field, $value)
 
 whereLikeParam ($field, $value)
 
 whereLikeValue ($field, $value)
 
 whereNotEquals ($field, $value)
 
 whereNotNull ($field)
 
 whereSubquery ($field, $operator, QueryBuilder $subquery)
 

Protected Member Functions

 addFieldPrefix ($field, $alias=null)
 

Member Function Documentation

◆ addFieldPrefix()

libAllure\QueryBuilder::addFieldPrefix (   $field,
  $alias = null 
)
protected

A field "prefix" is the table alias, plus a dot.

If the field already contains an alias, it is not added again.

If the alias param is null, the last alias is used.

◆ build()

libAllure\QueryBuilder::build ( )

Builds the actual SQL.

Returns
string The SQL string.