XOOPS  2.6.0
Xoops\Core\Database\QueryBuilder Class Reference
Inheritance diagram for Xoops\Core\Database\QueryBuilder:
Inheritance graph

Public Member Functions

 deletePrefix ($delete=null, $alias=null)
 
 fromPrefix ($from, $alias=null)
 
 innerJoinPrefix ($fromAlias, $join, $alias, $condition=null)
 
 insertPrefix ($insert=null)
 
 joinPrefix ($fromAlias, $join, $alias, $condition=null)
 
 leftJoinPrefix ($fromAlias, $join, $alias, $condition=null)
 
 rightJoinPrefix ($fromAlias, $join, $alias, $condition=null)
 
 updatePrefix ($update=null, $alias=null)
 

Detailed Description

Definition at line 31 of file QueryBuilder.php.

Member Function Documentation

Xoops\Core\Database\QueryBuilder::deletePrefix (   $delete = null,
  $alias = null 
)

Turns the query being built into a bulk delete query that ranges over a certain table.

$qb = $conn->createQueryBuilder() ->delete('users', 'u') ->where('u.id = :user_id'); ->setParameter(':user_id', 1);

Parameters
string$deleteThe table whose rows are subject to the deletion. Adds table prefix to table.
string$aliasThe table alias used in the constructed query.
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 51 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::fromPrefix (   $from,
  $alias = null 
)

Create and add a query root corresponding to the table identified by the given alias, forming a cartesian product with any existing query roots.

$qb = $conn->createQueryBuilder() ->select('u.id') ->from('users', 'u')

Parameters
string$fromThe table. Adds table prefix to table.
string | null$aliasThe alias of the table.
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 121 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::innerJoinPrefix (   $fromAlias,
  $join,
  $alias,
  $condition = null 
)

Creates and adds a join to the query.

$qb = $conn->createQueryBuilder() ->select('u.name') ->from('users', 'u') ->innerJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');

Parameters
string$fromAliasThe alias that points to a from clause
string$joinThe table name to join. Adds table prefix to table.
string$aliasThe alias of the join table
string$conditionThe condition for the join
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 168 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::insertPrefix (   $insert = null)

Turns the query being built into an insert query that inserts into a certain table

$qb = $conn->createQueryBuilder() ->insert('users') ->values( array( 'name' => '?', 'password' => '?' ) );

Parameters
string$insertThe table into which the rows should be inserted. Adds table prefix to table.
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 100 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::joinPrefix (   $fromAlias,
  $join,
  $alias,
  $condition = null 
)

Creates and adds a join to the query.

$qb = $conn->createQueryBuilder() ->select('u.name') ->from('users', 'u') ->join('u', 'phonenumbers', 'p', 'p.is_primary = 1');

Parameters
string$fromAliasThe alias that points to a from clause
string$joinThe table name to join. Adds table prefix to table.
string$aliasThe alias of the join table
string$conditionThe condition for the join
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 144 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::leftJoinPrefix (   $fromAlias,
  $join,
  $alias,
  $condition = null 
)

Creates and adds a left join to the query.

$qb = $conn->createQueryBuilder() ->select('u.name') ->from('users', 'u') ->leftJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');

Parameters
string$fromAliasThe alias that points to a from clause
string$joinThe table name to join. Adds table prefix to table.
string$aliasThe alias of the join table
string$conditionThe condition for the join
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 191 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::rightJoinPrefix (   $fromAlias,
  $join,
  $alias,
  $condition = null 
)

Creates and adds a right join to the query.

$qb = $conn->createQueryBuilder() ->select('u.name') ->from('users', 'u') ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');

Parameters
string$fromAliasThe alias that points to a from clause
string$joinThe table name to join. Adds table prefix to table.
string$aliasThe alias of the join table
string$conditionThe condition for the join
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 214 of file QueryBuilder.php.

References Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:

Xoops\Core\Database\QueryBuilder::updatePrefix (   $update = null,
  $alias = null 
)

Turns the query being built into a bulk update query that ranges over a certain table

$qb = $conn->createQueryBuilder() ->update('users', 'u') ->set('u.password', md5('password')) ->where('u.id = ?');

Parameters
string$updateThe table whose rows are subject to the update. Adds table prefix to table.
string$aliasThe table alias used in the constructed query.
Returns
QueryBuilder This QueryBuilder instance.

Definition at line 74 of file QueryBuilder.php.

References $update, and Xoops\Core\Database\Connection\prefix().

Here is the call graph for this function:


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