Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Connection
  • Factory
  • QueryBuilder
  • Overview
  • Namespace
  • Class
  • Tree

Class QueryBuilder

Connection wrapper for Doctrine DBAL Connection

PHP version 5.3

Doctrine\DBAL\Query\QueryBuilder
Extended by Xoops\Core\Database\QueryBuilder
Namespace: Xoops\Core\Database
Package: QueryBuilder
Category: Xoops\Core\Database\QueryBuilder
Copyright: 2013-2015 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: readheadedrod redheadedrod@hotmail.com
Author: Richard Griffith richard@geekwright.com
Version: Release: 2.6.0
Since: 2.6.0
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Database/QueryBuilder.php
Methods summary
public Xoops\Core\Database\QueryBuilder
# deletePrefix( string $delete = null, string $alias = null )

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

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

$delete

The table whose rows are subject to the deletion. Adds table prefix to table.

$alias
The table alias used in the constructed query.

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# updatePrefix( string $update = null, string $alias = null )

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

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

$update

The table whose rows are subject to the update. Adds table prefix to table.

$alias
The table alias used in the constructed query.

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# insertPrefix( string $insert = null )

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

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

$insert

The table into which the rows should be inserted. Adds table prefix to table.

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# fromPrefix( string $from, string|null $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.

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

$from
The table. Adds table prefix to table.
$alias
The alias of the table.

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# joinPrefix( string $fromAlias, string $join, string $alias, string $condition = null )

Creates and adds a join to the query.

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

$fromAlias
The alias that points to a from clause
$join
The table name to join. Adds table prefix to table.
$alias
The alias of the join table
$condition
The condition for the join

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# innerJoinPrefix( string $fromAlias, string $join, string $alias, string $condition = null )

Creates and adds a join to the query.

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

$fromAlias
The alias that points to a from clause
$join
The table name to join. Adds table prefix to table.
$alias
The alias of the join table
$condition
The condition for the join

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# leftJoinPrefix( string $fromAlias, string $join, string $alias, string $condition = null )

Creates and adds a left join to the query.

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

$fromAlias
The alias that points to a from clause
$join
The table name to join. Adds table prefix to table.
$alias
The alias of the join table
$condition
The condition for the join

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
public Xoops\Core\Database\QueryBuilder
# rightJoinPrefix( string $fromAlias, string $join, string $alias, string $condition = null )

Creates and adds a right join to the query.

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

$fromAlias
The alias that points to a from clause
$join
The table name to join. Adds table prefix to table.
$alias
The alias of the join table
$condition
The condition for the join

Returns

Xoops\Core\Database\QueryBuilder
This QueryBuilder instance.
API documentation generated by ApiGen