Overview

Namespaces

  • Pomm
    • Connection
    • Converter
    • Exception
    • Identity
    • Object
    • Query
    • Tools
    • Type

Classes

  • PreparedQuery
  • Where
  • Overview
  • Namespace
  • Class
  • Tree

Class Where

Where

This class represents a WHERE clause of a SQL statement. It deals with AND & OR operator you can add using handy methods. This allows you to build queries dynamically.

Namespace: Pomm\Query
Package: Pomm
Copyright: 2011 - 2013 Grégoire HUBERT
License: {@link http://opensource.org/licenses/mit-license.php}
Author: Grégoire HUBERT <hubert.greg@gmail.com>
Version: $id$
Used by: Pomm\Object\BaseObjectMap
Located at Query/Where.php
Methods summary
public static Pomm\Query\Where
# create( String $element = null, array $values = array() )

create

create

A constructor you can chain from.

Parameters

$element
String
$element Optional logical element.
$values
Array
$values Optional elements' values.

Returns

Pomm\Query\Where
public static Pomm\Query\Where
# createWhereIn( String $element, array $values )

createWhereIn

createWhereIn

Create an escaped IN clause.

Parameters

$element
String
$element
$values
Array
$values

Returns

Pomm\Query\Where
public
# __construct( String $element = null, array $values = array() )

__construct

__construct

Parameters

$element
String
$element (optional)
$values
Array
$values (optional)
public Pomm\Query\Where
# setOperator( String $operator )

setOperator

setOperator

is it an AND or an OR ? or something else (XOR maybe).

Parameters

$operator
String
$operator

Returns

Pomm\Query\Where
public Boolean
# isEmpty( )

isEmpty

isEmpty

is it a fresh brand new object ?

Returns

Boolean
public
# transmute( Pomm\Query\Where $where )

transmute

transmute

Absorbing another Where instance.

Parameters

$where
Pomm\Query\Where
$where
public Pomm\Query\Where
# addWhere( Mixed $element, array $values, String $operator )

addWhere

addWhere

You can add a new WHERE clause with your own operator.

Parameters

$element
Mixed
$element
$values
Array
$values
$operator
String
$operator

Returns

Pomm\Query\Where
public Pomm\Query\Where
# andWhere( Mixed $element, array $values = array() )

andWhere

andWhere

Or use a ready to use AND where clause.

Parameters

$element
Mixed
$element
$values
Array
$values

Returns

Pomm\Query\Where
public Pomm\Query\Where
# orWhere( Mixed $element, array $values = array() )

orWhere

orWhere

Parameters

$element
Mixed
$element
$values
Array
$values

Returns

Pomm\Query\Where
public Pomm\Query\Where
# setStack( array $stack )

setStack

setStack

Parameters

$stack
Array
$stack

Returns

Pomm\Query\Where
public String
# __toString( )

__toString

__toString

where your SQL statement is built.

Returns

String
public Boolean
# hasElement( )

hasElement

hasElement

Returns

Boolean
public String
# getElement( )

getElement

getElement

Returns

String
protected String
# parse( )

parse

parse

Returns

String
public Array
# getValues( )

getValues

getValues

Get all the values back for the prepared statement.

Returns

Array
Properties summary
public array $stack array()
#
public mixed $element
#
public array $values array()
#
public mixed $operator
#
Pomm 1.2 API documentation generated by ApiGen 2.8.0