SQL query builder
- Class name: DbQueryCore
- Source: classes/db/DbQuery.php line 33
- __toString
- build
- from
- groupBy
- having
- innerJoin
- join
- leftJoin
- leftOuterJoin
- limit
- naturalJoin
- orderBy
- select
- where
protected array $query = array('select' => array(), 'from' => '', 'join' => array(), 'where' => array(), 'group' => array(), 'having' => array(), 'order' => array(), 'limit' => array('offset' => 0, 'limit' => 0))
- Visibility: protected
- Source: classes/db/DbQuery.php line 38.
mixed DbQueryCore::__toString()
- Visibility: public
- Source: classes/db/DbQuery.php line 250
string DbQueryCore::build()
Generate and get the query
- Visibility: public
- Source: classes/db/DbQuery.php line 218
\DbQuery DbQueryCore::from(string $table, $alias)
Set table for FROM clause
- Visibility: public
- Source: classes/db/DbQuery.php line 68
- $table string - Table name
- $alias mixed
\DbQuery DbQueryCore::groupBy(string $fields)
Add a GROUP BY restriction
- Visibility: public
- Source: classes/db/DbQuery.php line 186
- $fields string - List of fields to sort. E.g. $this->group('myField, b.mySecondField DESC')
\DbQuery DbQueryCore::having(string $restriction)
Add a restriction in HAVING clause (each restriction will be separated by AND statement)
- Visibility: public
- Source: classes/db/DbQuery.php line 158
- $restriction string
mixed DbQueryCore::innerJoin(string $table, string $alias, string $on)
Add INNER JOIN clause E.g. $this->innerJoin('product p ON .
..')
- Visibility: public
- Source: classes/db/DbQuery.php line 110
- $table string - Table name (without prefix)
- $alias string - Table alias
- $on string - ON clause
\DbQuery DbQueryCore::join(string $join)
Add JOIN clause E.g. $this->join('RIGHT JOIN '.DB_PREFIX.'product p ON .
..');
- Visibility: public
- Source: classes/db/DbQuery.php line 82
- $join string - Complete string
mixed DbQueryCore::leftJoin(string $table, string $alias, string $on)
Add LEFT JOIN clause
- Visibility: public
- Source: classes/db/DbQuery.php line 97
- $table string - Table name (without prefix)
- $alias string - Table alias
- $on string - ON clause
mixed DbQueryCore::leftOuterJoin(string $table, string $alias, string $on)
Add LEFT OUTER JOIN clause
- Visibility: public
- Source: classes/db/DbQuery.php line 122
- $table string - Table name (without prefix)
- $alias string - Table alias
- $on string - ON clause
\DbQuery DbQueryCore::limit($limit, $offset)
Limit results in query
- Visibility: public
- Source: classes/db/DbQuery.php line 200
- $limit mixed
- $offset mixed
mixed DbQueryCore::naturalJoin(string $table, string $alias)
Add NATURAL JOIN clause
- Visibility: public
- Source: classes/db/DbQuery.php line 133
- $table string - Table name (without prefix)
- $alias string - Table alias
\DbQuery DbQueryCore::orderBy(string $fields)
Add an ORDER B restriction
- Visibility: public
- Source: classes/db/DbQuery.php line 172
- $fields string - List of fields to sort. E.g. $this->order('myField, b.mySecondField DESC')
\DbQuery DbQueryCore::select(string $fields)
Add fields in query selection
- Visibility: public
- Source: classes/db/DbQuery.php line 55
- $fields string - List of fields to concat to other fields
\DbQuery DbQueryCore::where(string $restriction)
Add a restriction in WHERE clause (each restriction will be separated by AND statement)
- Visibility: public
- Source: classes/db/DbQuery.php line 144
- $restriction string