Joomla CMS  2.5.24 (avec JPlatform 11.4 inclus)
Documentation des API du CMS Joomla en version 2.5 et du framework Joomla Platform intégré
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JDatabaseQuery
+ Graphe d'héritage de JDatabaseQuery:

Liste de tous les membres

Fonctions membres publiques

 __call ($method, $args)
 __construct (JDatabase $db=null)
 __toString ()
 __get ($name)
 castAsChar ($value)
 charLength ($field)
 clear ($clause=null)
 columns ($columns)
 concatenate ($values, $separator=null)
 currentTimestamp ()
 dateFormat ()
 dump ()
 delete ($table=null)
 escape ($text, $extra=false)
 from ($tables)
 group ($columns)
 having ($conditions, $glue= 'AND')
 innerJoin ($condition)
 insert ($table, $incrementField=false)
 join ($type, $conditions)
 leftJoin ($condition)
 length ($value)
 nullDate ($quoted=true)
 order ($columns)
 outerJoin ($condition)
 quote ($text, $escape=true)
 quoteName ($name)
 rightJoin ($condition)
 select ($columns)
 set ($conditions, $glue= ',')
 update ($table)
 values ($values)
 where ($conditions, $glue= 'AND')
 __clone ()
 union ($query, $distinct=false, $glue= '')
 unionDistinct ($query, $glue= '')

Attributs protégés

 $db = null
 $type = ''
 $element = null
 $select = null
 $delete = null
 $update = null
 $insert = null
 $from = null
 $join = null
 $set = null
 $where = null
 $group = null
 $having = null
 $columns = null
 $values = null
 $order = null
 $union = null
 $autoIncrementField = null

Documentation des constructeurs et destructeur

JDatabaseQuery::__construct ( JDatabase  $db = null)

Class constructor.

Paramètres:
JDatabase$dbThe database connector resource.
Depuis:
11.1

Références $db.


Documentation des fonctions membres

JDatabaseQuery::__call (   $method,
  $args 
)

Magic method to provide method alias support for quote() and quoteName().

Paramètres:
string$methodThe called method.
array$argsThe array of arguments passed to the method.
Renvoie:
string The aliased method's return value or null.
Depuis:
11.1

Références escape(), quote(), et quoteName().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::__clone ( )

Method to provide deep copy support to nested objects and arrays when cloning.

Renvoie:
void
Depuis:
11.3
JDatabaseQuery::__get (   $name)

Magic function to get protected variable value

Paramètres:
string$nameThe name of the variable.
Renvoie:
mixed
Depuis:
11.1

Références $name, et null.

JDatabaseQuery::__toString ( )

Magic function to convert the query to a string.

Renvoie:
string The completed query.
Depuis:
11.1

Réimplémentée dans JDatabaseQuerySQLSrv.

Références $join, $query, columns(), elseif, from(), group(), having(), insert(), join(), order(), select(), update(), values(), et where().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::castAsChar (   $value)

Casts a value to a char.

Ensure that the value is properly quoted before passing to the method.

Usage: $query->select($query->castAsChar('a'));

Paramètres:
string$valueThe value to cast as a char.
Renvoie:
string Returns the cast value.
Depuis:
11.1

Réimplémentée dans JDatabaseQuerySQLSrv.

JDatabaseQuery::charLength (   $field)

Gets the number of characters in a string.

Note, use 'length' to find the number of bytes in a string.

Usage: $query->select($query->charLength('a'));

Paramètres:
string$fieldA value.
Renvoie:
string The required char length call.
Depuis:
11.1

Réimplémentée dans JDatabaseQuerySQLSrv.

Références $field.

JDatabaseQuery::clear (   $clause = null)

Clear data from the query or a specific clause of the query.

Paramètres:
string$clauseOptionally, the name of the clause to clear, or nothing to clear the whole query.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références columns(), from(), group(), having(), insert(), join(), null, order(), select(), update(), values(), et where().

Référencé par union().

+ Voici le graphe d'appel pour cette fonction :

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::columns (   $columns)

Adds a column, or array of column names that would be used for an INSERT INTO statement.

Paramètres:
mixed$columnsA column name, or array of column names.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références $columns.

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::concatenate (   $values,
  $separator = null 
)

Concatenates an array of column names or values.

Usage: $query->select($query->concatenate(array('a', 'b')));

Paramètres:
array$valuesAn array of values to concatenate.
string$separatorAs separator to place between each value.
Renvoie:
string The concatenated values.
Depuis:
11.1

Réimplémentée dans JDatabaseQuerySQLSrv, et JDatabaseQueryMySQL.

Références $separator, $values, et quote().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::currentTimestamp ( )

Gets the current date and time.

Usage: $query->where('published_up < '.$query->currentTimestamp());

Renvoie:
string
Depuis:
11.1

Réimplémentée dans JDatabaseQuerySQLSrv.

JDatabaseQuery::dateFormat ( )

Returns a PHP date() function compliant date format for the database driver.

This method is provided for use where the query object is passed to a function for modification. If you have direct access to the database object, it is recommended you use the getDateFormat method directly.

Renvoie:
string The format string.
Depuis:
11.1
JDatabaseQuery::delete (   $table = null)

Add a table name to the DELETE clause of the query.

Note that you must not mix insert, update, delete and select method calls when building a query.

Usage: $query->delete('#__a')->where('id = 1');

Paramètres:
string$tableThe name of the table to delete from.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références from(), et null.

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::dump ( )

Creates a formatted dump of the query for debugging purposes.

Usage: echo $query->dump();

Renvoie:
string
Depuis:
11.3
JDatabaseQuery::escape (   $text,
  $extra = false 
)

Method to escape a string for usage in an SQL statement.

This method is provided for use where the query object is passed to a function for modification. If you have direct access to the database object, it is recommended you use the escape method directly.

Note that 'e' is an alias for this method as it is in JDatabase.

Paramètres:
string$textThe string to be escaped.
boolean$extraOptional parameter to provide extra escaping.
Renvoie:
string The escaped string.
Depuis:
11.1
Exceptions:
DatabaseErrorif the internal db property is not a valid object.

Références $text.

Référencé par __call().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::from (   $tables)

Add a table to the FROM clause of the query.

Note that while an array of tables can be provided, it is recommended you use explicit joins.

Usage: $query->select('*')->from('#__a');

Paramètres:
mixed$tablesA string or array of table names.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Référencé par __toString(), clear(), et delete().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::group (   $columns)

Add a grouping column to the GROUP clause of the query.

Usage: $query->group('id');

Paramètres:
mixed$columnsA string or array of ordering columns.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références $columns.

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::having (   $conditions,
  $glue = 'AND' 
)

A conditions to the HAVING clause of the query.

Usage: $query->group('id')->having('COUNT(id) > 5');

Paramètres:
mixed$conditionsA string or array of columns.
string$glueThe glue by which to join the conditions. Defaults to AND.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::innerJoin (   $condition)

Add an INNER JOIN clause to the query.

Usage: $query->innerJoin('b ON b.id = a.id')->innerJoin('c ON c.id = b.id');

Paramètres:
string$conditionThe join condition.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références join().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::insert (   $table,
  $incrementField = false 
)

Add a table name to the INSERT clause of the query.

Note that you must not mix insert, update, delete and select method calls when building a query.

Usage: $query->insert('#__a')->set('id = 1'); $query->insert('#__a)->columns('id, title')->values('1,2')->values->('3,4'); $query->insert('#__a)->columns('id, title')->values(array('1,2', '3,4'));

Paramètres:
mixed$tableThe name of the table to insert data into.
boolean$incrementFieldThe name of the field to auto increment.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::join (   $type,
  $conditions 
)

Add a JOIN clause to the query.

Usage: $query->join('INNER', 'b ON b.id = a.id);

Paramètres:
string$typeThe type of join. This string is prepended to the JOIN keyword.
string$conditionsA string or array of conditions.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références $type.

Référencé par __toString(), clear(), innerJoin(), leftJoin(), outerJoin(), et rightJoin().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::leftJoin (   $condition)

Add a LEFT JOIN clause to the query.

Usage: $query->leftJoin('b ON b.id = a.id')->leftJoin('c ON c.id = b.id');

Paramètres:
string$conditionThe join condition.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références join().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::length (   $value)

Get the length of a string in bytes.

Note, use 'charLength' to find the number of characters in a string.

Usage: query->where($query->length('a').' > 3');

Paramètres:
string$valueThe string to measure.
Renvoie:
int
Depuis:
11.1

Réimplémentée dans JDatabaseQuerySQLSrv.

JDatabaseQuery::nullDate (   $quoted = true)

Get the null or zero representation of a timestamp for the database driver.

This method is provided for use where the query object is passed to a function for modification. If you have direct access to the database object, it is recommended you use the nullDate method directly.

Usage: $query->where('modified_date <> '.$query->nullDate());

Paramètres:
boolean$quotedOptionally wraps the null date in database quotes (true by default).
Renvoie:
string Null or zero representation of a timestamp.
Depuis:
11.1
JDatabaseQuery::order (   $columns)

Add a ordering column to the ORDER clause of the query.

Usage: $query->order('foo')->order('bar'); $query->order(array('foo','bar'));

Paramètres:
mixed$columnsA string or array of ordering columns.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références $columns.

Référencé par __toString(), clear(), et union().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::outerJoin (   $condition)

Add an OUTER JOIN clause to the query.

Usage: $query->outerJoin('b ON b.id = a.id')->outerJoin('c ON c.id = b.id');

Paramètres:
string$conditionThe join condition.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références join().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::quote (   $text,
  $escape = true 
)

Method to quote and optionally escape a string to database requirements for insertion into the database.

This method is provided for use where the query object is passed to a function for modification. If you have direct access to the database object, it is recommended you use the quote method directly.

Note that 'q' is an alias for this method as it is in JDatabase.

Usage: $query->quote('fulltext'); $query->q('fulltext');

Paramètres:
string$textThe string to quote.
boolean$escapeTrue to escape the string, false to leave it unchanged.
Renvoie:
string The quoted input string.
Depuis:
11.1
Exceptions:
DatabaseErrorif the internal db property is not a valid object.

Références $text.

Référencé par __call(), et concatenate().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::quoteName (   $name)

Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.

This method is provided for use where the query object is passed to a function for modification. If you have direct access to the database object, it is recommended you use the quoteName method directly.

Note that 'qn' is an alias for this method as it is in JDatabase.

Usage: $query->quoteName('#__a'); $query->qn('#__a');

Paramètres:
string$nameThe identifier name to wrap in quotes.
Renvoie:
string The quote wrapped name.
Depuis:
11.1
Exceptions:
DatabaseErrorif the internal db property is not a valid object.

Références $name.

Référencé par __call().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::rightJoin (   $condition)

Add a RIGHT JOIN clause to the query.

Usage: $query->rightJoin('b ON b.id = a.id')->rightJoin('c ON c.id = b.id');

Paramètres:
string$conditionThe join condition.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références join().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::select (   $columns)

Add a single column, or array of columns to the SELECT clause of the query.

Note that you must not mix insert, update, delete and select method calls when building a query. The select method can, however, be called multiple times in the same query.

Usage: $query->select('a.*')->select('b.id'); $query->select(array('a.*', 'b.id'));

Paramètres:
mixed$columnsA string or an array of field names.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références $columns.

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::set (   $conditions,
  $glue = ',' 
)

Add a single condition string, or an array of strings to the SET clause of the query.

Usage: $query->set('a = 1')->set('b = 2'); $query->set(array('a = 1', 'b = 2');

Paramètres:
mixed$conditionsA string or array of string conditions.
string$glueThe glue by which to join the condition strings. Defaults to ,. Note that the glue is set on first use and cannot be changed.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1
JDatabaseQuery::union (   $query,
  $distinct = false,
  $glue = '' 
)

Add a query to UNION with the current query. Multiple unions each require separate statements and create an array of unions.

Usage: $query->union('SELECT name FROM #__foo') $query->union('SELECT name FROM #__foo','distinct') $query->union(array('SELECT name FROM #__foo','SELECT name FROM #__bar'))

Paramètres:
mixed$queryThe JDatabaseQuery object or string to union.
boolean$distinctTrue to only return distinct rows from the union.
string$glueThe glue by which to join the conditions.
Renvoie:
mixed The JDatabaseQuery object on success or boolean false on failure.
Depuis:
12.1

Références $name, $query, clear(), et order().

+ Voici le graphe d'appel pour cette fonction :

JDatabaseQuery::unionDistinct (   $query,
  $glue = '' 
)

Add a query to UNION DISTINCT with the current query. Simply a proxy to Union with the Distinct clause.

Usage: $query->unionDistinct('SELECT name FROM #__foo')

Paramètres:
mixed$queryThe JDatabaseQuery object or string to union.
string$glueThe glue by which to join the conditions.
Renvoie:
mixed The JDatabaseQuery object on success or boolean false on failure.
Depuis:
12.1

Références $query.

JDatabaseQuery::update (   $table)

Add a table name to the UPDATE clause of the query.

Note that you must not mix insert, update, delete and select method calls when building a query.

Usage: $query->update('#__foo')->set(...);

Paramètres:
string$tableA table to update.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::values (   $values)

Adds a tuple, or array of tuples that would be used as values for an INSERT INTO statement.

Usage: $query->values('1,2,3')->values('4,5,6'); $query->values(array('1,2,3', '4,5,6'));

Paramètres:
string$valuesA single tuple, or array of tuples.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Références $values.

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :

JDatabaseQuery::where (   $conditions,
  $glue = 'AND' 
)

Add a single condition, or an array of conditions to the WHERE clause of the query.

Usage: $query->where('a = 1')->where('b = 2'); $query->where(array('a = 1', 'b = 2'));

Paramètres:
mixed$conditionsA string or array of where conditions.
string$glueThe glue by which to join the conditions. Defaults to AND. Note that the glue is set on first use and cannot be changed.
Renvoie:
JDatabaseQuery Returns this object to allow chaining.
Depuis:
11.1

Référencé par __toString(), et clear().

+ Voici le graphe des appelants de cette fonction :


Documentation des données membres

JDatabaseQuery::$autoIncrementField = null
protected
JDatabaseQuery::$columns = null
protected

Référencé par columns(), group(), order(), et select().

JDatabaseQuery::$db = null
protected

Référencé par __construct().

JDatabaseQuery::$delete = null
protected
JDatabaseQuery::$element = null
protected
JDatabaseQuery::$from = null
protected
JDatabaseQuery::$group = null
protected
JDatabaseQuery::$having = null
protected
JDatabaseQuery::$insert = null
protected
JDatabaseQuery::$join = null
protected

Référencé par __toString().

JDatabaseQuery::$order = null
protected
JDatabaseQuery::$select = null
protected
JDatabaseQuery::$set = null
protected
JDatabaseQuery::$type = ''
protected

Référencé par join().

JDatabaseQuery::$union = null
protected
JDatabaseQuery::$update = null
protected
JDatabaseQuery::$values = null
protected

Référencé par concatenate(), et values().

JDatabaseQuery::$where = null
protected

La documentation de cette classe a été générée à partir du fichier suivant :