BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
DPL\Query Class Reference

Public Member Functions

 __construct (Parameters $parameters)
 
 buildAndSelect ($calcRows=false)
 
 getFoundRows ()
 
 getSqlQuery ()
 
 addTable ($table, $alias)
 
 addWhere ($where)
 
 addNotWhere ($where)
 
 addSelect ($fields)
 
 addGroupBy ($groupBy)
 
 addOrderBy ($orderBy)
 
 addJoin ($tableAlias, $joinConditions)
 
 setLimit ($limit)
 
 setOffset ($offset)
 
 setOrderDir ($direction)
 
 setCollation ($collation)
 
 getCollateSQL ()
 

Static Public Member Functions

static getTableNames ()
 
static getSubcategories ($categoryName, $depth=1)
 

Constructor & Destructor Documentation

DPL\Query::__construct ( Parameters  $parameters)

Main Constructor

public

Parameters
objectParameters
Returns
void

Member Function Documentation

DPL\Query::addGroupBy (   $groupBy)

Add a GROUP BY clause to the output.

public

Parameters
stringGroup By Clause
Returns
boolean Success
DPL\Query::addJoin (   $tableAlias,
  $joinConditions 
)

Add a JOIN clause to the output.

public

Parameters
stringTable Alias
arrayJoin Conditions in the format of the join type to the on where condition. Example: ['JOIN TYPE' => 'this = that']
Returns
boolean Success
DPL\Query::addNotWhere (   $where)

Add a where clause to the output that uses NOT IN or !=.

public

Parameters
arrayField => Value(s)
Returns
boolean Success
DPL\Query::addOrderBy (   $orderBy)

Add a ORDER BY clause to the output.

public

Parameters
stringOrder By Clause
Returns
boolean Success
DPL\Query::addSelect (   $fields)

Add a field to select. Will ignore duplicate values if the exact same alias and exact same field are passed.

public

Parameters
arrayArray of fields with the array key being the field alias. Leave the array key as a numeric index to not specify an alias.
Returns
boolean Success
DPL\Query::addTable (   $table,
  $alias 
)

Add a table to the output.

public

Parameters
stringRaw Table Name - Will be ran through tableName().
stringTable Alias
Returns
boolean Success - Added, false if the table alias already exists.
DPL\Query::addWhere (   $where)

Add a where clause to the output. Where clauses get imploded together with AND at the end. Any custom where clauses should be preformed before placed into here.

public

Parameters
stringWhere clause
Returns
boolean Success
DPL\Query::buildAndSelect (   $calcRows = false)

Start a query build.

public

Parameters
booleanCalculate Found Rows
Returns
mixed Mediawiki Result Object or False
DPL\Query::getCollateSQL ( )

Return SQL prefixed collation.

public

Returns
string SQL Collation
DPL\Query::getFoundRows ( )

Return the number of found rows.

public

Returns
integer Number of Found Rows
DPL\Query::getSqlQuery ( )

Returns the generated SQL Query

public

Returns
string SQL Query
static DPL\Query::getSubcategories (   $categoryName,
  $depth = 1 
)
static

Recursively get and return an array of subcategories.

public

Parameters
stringCategory Name
integer[Optional] Maximum Depth
Returns
array Subcategories
static DPL\Query::getTableNames ( )
static

Return prefixed and quoted tables that are needed.

public

Returns
array Prepared table names.
DPL\Query::setCollation (   $collation)

Set the character set collation.

public

Parameters
stringCollation
Returns
void
DPL\Query::setLimit (   $limit)

Set the limit.

public

Parameters
mixedInteger limit or false to unset.
Returns
boolean Success
DPL\Query::setOffset (   $offset)

Set the offset.

public

Parameters
mixedInteger offset or false to unset.
Returns
boolean Success
DPL\Query::setOrderDir (   $direction)

Set the ORDER BY direction

public

Parameters
stringSQL direction key word.
Returns
boolean Success

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