Overview

Namespaces

  • Alchemy
    • core
      • query
      • schema
    • dialect
    • engine
    • orm
    • tests
    • util
      • promise
  • PHP

Classes

  • ColumnRef
  • DDLQuery
  • Expression
  • Insert
  • Join
  • Predicate
  • Query
  • Scalar
  • TableRef

Interfaces

  • IQuery
  • IQueryFragment
  • IQueryValue
  • Overview
  • Namespace
  • Class
  • Tree

Class Query

Represents a generalized SQL query

Alchemy\core\Element implements Alchemy\core\IElement
Extended by Alchemy\core\query\Query implements Alchemy\core\query\IQuery

Direct known subclasses

Alchemy\core\query\Insert, Alchemy\orm\ORMQuery
Namespace: Alchemy\core\query
Located at alchemy/core/query/Query.php
Methods summary
public
# __construct( mixed $type, Alchemy\core\query\TableRef $table )

Overrides

Alchemy\core\Element::__construct()
public
# __set( mixed $name, mixed $value )
public array
# columns( )

Add multiple columns to the query by providing multiple arguments. See Query::column() Pass, ColumnRefs, ["Name", Value] pairs, or a single array of either as necessary.

Add multiple columns to the query by providing multiple arguments. See Query::column() Pass, ColumnRefs, ["Name", Value] pairs, or a single array of either as necessary.

Returns

array
current column list if no arguments
public array
# parameters( )

Recursively get all scalar parameters used by this expression

Recursively get all scalar parameters used by this expression

Returns

array
array(Scalar, Scalar, ...)

Implementation of

Alchemy\core\query\IQueryFragment::parameters()
public
# join( Table $table, Alchemy\core\query\Predicate $on = null, mixed $direction = null, mixed $type = null )

Add a join to the query

Add a join to the query

Parameters

$table
Table
$table
$on
Alchemy\core\query\Predicate
$on
$direction
mixed
$direction Optional join direction
$type
mixed
$type Optional join type
public
# joins( )
public
# outerJoin( Table $table, Alchemy\core\query\Predicate $on, mixed $direction = null )

Shortcut for doing an OUTER JOIN

Shortcut for doing an OUTER JOIN

Parameters

$table
Table
$table
$on
Alchemy\core\query\Predicate
$on
$direction
mixed
$direction Optional join direction
public Alchemy\core\query\TableRef
# table( )

Return the table this query applies to

Return the table this query applies to

Returns

Alchemy\core\query\TableRef
$table
public
# where( Alchemy\core\query\Expression $expr = false )

Set the Query's WHERE expression. Calling this multiple times will overwrite the previous expressions. You should instead call this once with a CompoundExpression.

Set the Query's WHERE expression. Calling this multiple times will overwrite the previous expressions. You should instead call this once with a CompoundExpression.

Parameters

$expr
Alchemy\core\query\Expression
$expr
public
# limit( integer $limit = false )

Limit number of rows affected by query.

Limit number of rows affected by query.

Parameters

$limit
integer
$limit Query limit.
public
# offset( integer $offset = false )

Offset start of rows affected by query.

Offset start of rows affected by query.

Parameters

$offset
integer
$offset Query offset.
Methods inherited from Alchemy\core\Element
__callStatic(), __clone(), addTag(), addTags(), copy(), define(), define_alias(), getDescription(), getID(), getTag(), getType(), get_definition(), listTags(), normalize_arg()
Properties summary
protected array $columns array()
#
protected array $joins array()
#
protected mixed $where
#
protected mixed $limit
#
protected mixed $offset
#
protected mixed $table
#
Properties inherited from Alchemy\core\Element
$id, $tags, $type
API documentation generated by ApiGen 2.8.0