Zend Framework  3.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Join Class Reference

Aggregate JOIN specifications. More...

Public Member Functions

 __construct ()
 Initialize iterator position.
 
 rewind ()
 Rewind iterator.
 
 current ()
 Return current join specification.
 
 key ()
 Return the current iterator index.
 
 next ()
 Advance to the next JOIN specification.
 
 valid ()
 Is the iterator at a valid position?
 
 getJoins ()
 
 join ($name, $on, $columns=[Select::SQL_STAR], $type=Join::JOIN_INNER)
 
 reset ()
 Reset to an empty list of JOIN specifications.
 
 count ()
 Get count of attached predicates.
 

Public Attributes

const JOIN_INNER = 'inner'
 
const JOIN_OUTER = 'outer'
 
const JOIN_LEFT = 'left'
 
const JOIN_RIGHT = 'right'
 
const JOIN_RIGHT_OUTER = 'right outer'
 
const JOIN_LEFT_OUTER = 'left outer'
 

Protected Attributes

 $joins = []
 

Detailed Description

Aggregate JOIN specifications.

Each specification is an array with the following keys:

Constructor & Destructor Documentation

__construct ( )

Initialize iterator position.

Member Function Documentation

count ( )

Get count of attached predicates.

Returns
int
current ( )

Return current join specification.

Returns
array
getJoins ( )
Returns
array
join (   $name,
  $on,
  $columns = [Select::SQL_STAR],
  $type = Join::JOIN_INNER 
)
Parameters
string | array$nameA table name on which to join, or a single element associative array, of the form alias => table
string$onA string specification describing the fields to join on.
string|string[]|int|int[]$columns A single column name, an array of column names, or (a) specification(s) such as SQL_STAR representing the columns to join.
string$typeThe JOIN type to use; see the JOIN_* constants.
Returns
self Implements a fluent interface.
Exceptions
Exception\InvalidArgumentExceptionfor invalid $name values.
key ( )

Return the current iterator index.

Returns
int
next ( )

Advance to the next JOIN specification.

reset ( )

Reset to an empty list of JOIN specifications.

Returns
self Implements a fluent interface.
rewind ( )

Rewind iterator.

valid ( )

Is the iterator at a valid position?

Returns
bool

Member Data Documentation

$joins = []
protected
const JOIN_INNER = 'inner'
const JOIN_LEFT = 'left'
const JOIN_LEFT_OUTER = 'left outer'
const JOIN_OUTER = 'outer'
const JOIN_RIGHT = 'right'
const JOIN_RIGHT_OUTER = 'right outer'