Overview

Namespaces

  • Neevo
    • Cache
    • Drivers
    • Nette
  • PHP

Classes

  • BaseStatement
  • Connection
  • Literal
  • Loader
  • Manager
  • Parser
  • Result
  • ResultIterator
  • Row
  • Statement

Interfaces

  • ICache
  • IDriver
  • IObservable
  • IObserver

Exceptions

  • DriverException
  • ImplementationException
  • NeevoException
  • Overview
  • Namespace
  • Class
  • Tree

Class BaseStatement

Neevo statement abstract base ancestor.

Neevo\BaseStatement implements Neevo\IObservable

Direct known subclasses

Neevo\Result, Neevo\Statement
Abstract
Namespace: Neevo
Author: Smasty
Located at Neevo/BaseStatement.php
Methods summary
public
# __construct( Neevo\Connection $connection )

Create statement.

Create statement.

Parameters

$connection
Neevo\Connection
public string
# __toString( )

String representation of object.

String representation of object.

Returns

string
public
# __clone( )

Create clone of object.

Create clone of object.

public Neevo\BaseStatement
# where( string|array|Traversable $expr, mixed $value = true )

Set WHERE condition. Accepts infinite arguments.

Set WHERE condition. Accepts infinite arguments.

More calls append conditions with 'AND' operator. Conditions can also be specified by calling and() / or() methods the same way as where(). Corresponding operator will be used.

Accepts associative array in field => value form.

Parameters

$expr
string|array|Traversable
$value
mixed

Returns

Neevo\BaseStatement
fluent interface
public Neevo\BaseStatement
# order( string|array|Traversable $rule, string $order = null )

Define order. More calls append rules.

Define order. More calls append rules.

Parameters

$rule
string|array|Traversable
$order
string
Use constants - Manager::ASC, Manager::DESC

Returns

Neevo\BaseStatement
fluent interface
public Neevo\BaseStatement
# limit( integer $limit, integer $offset = null )

Set LIMIT and OFFSET clauses.

Set LIMIT and OFFSET clauses.

Parameters

$limit
integer
$offset
integer

Returns

Neevo\BaseStatement
fluent interface
public Neevo\BaseStatement
# rand( )

Randomize order. Removes any other order clause.

Randomize order. Removes any other order clause.

Returns

Neevo\BaseStatement
fluent interface
public string|Neevo\BaseStatement
# dump( boolean $return = false )

Print out syntax highlighted statement.

Print out syntax highlighted statement.

Parameters

$return
boolean

Returns

string|Neevo\BaseStatement
fluent interface
public resource|boolean
# run( )

Perform the statement.

Perform the statement.

Returns

resource|boolean
public resource|boolean
# exec( )

Perform the statement. Alias for run().

Perform the statement. Alias for run().

Returns

resource|boolean
public
# attachObserver( Neevo\IObserver $observer, integer $event )

Attach given observer to given event.

Attach given observer to given event.

Parameters

$observer
Neevo\IObserver
$event
integer

Implementation of

Neevo\IObservable::attachObserver
public
# detachObserver( Neevo\IObserver $observer )

Detach given observer.

Detach given observer.

Parameters

$observer
Neevo\IObserver

Implementation of

Neevo\IObservable::detachObserver
public
# notifyObservers( integer $event )

Notify all observers attached to given event.

Notify all observers attached to given event.

Parameters

$event
integer

Implementation of

Neevo\IObservable::notifyObservers
public integer
# getTime( )

Query execution time.

Query execution time.

Returns

integer
public boolean
# isPerformed( )

If query was performed.

If query was performed.

Returns

boolean
public string
# getTable( )

Get full table name (with prefix).

Get full table name (with prefix).

Returns

string
public string
# getType( )

Statement type.

Statement type.

Returns

string
public array
# getLimit( )

Get LIMIT and OFFSET clauses.

Get LIMIT and OFFSET clauses.

Returns

array
public array
# getConditions( )

Statement WHERE clause.

Statement WHERE clause.

Returns

array
public array
# getSorting( )

Statement ORDER BY clause.

Statement ORDER BY clause.

Returns

array
public string|null
# getPrimaryKey( )

Name of the PRIMARY KEY column.

Name of the PRIMARY KEY column.

Returns

string|null
public Neevo\Connection
# getConnection( )

Get the connection instance.

Get the connection instance.

Returns

Neevo\Connection
protected
# resetState( )

Reset the state of the statement.

Reset the state of the statement.

protected boolean
# validateConditions( )

Validate the current statement condition.

Validate the current statement condition.

Returns

boolean
protected boolean
# hasCircularReferences( Neevo\BaseStatement $parent, array $visited = array() )

Check the query tree for circular references.

Check the query tree for circular references.

Parameters

$parent
Neevo\BaseStatement
$visited
array

Returns

boolean
True if circular reference found.
Properties summary
protected string $source
#
protected string $type
#
protected integer $limit
#
protected integer $offset
#
protected array $conditions array()
#
protected array $sorting array()
#
protected float $time
#
protected boolean $performed
#
protected Neevo\Connection $connection
#
protected static array $eventTable array( Manager::STMT_SELECT => IObserver::SELECT, Manager::STMT_INSERT => IObserver::INSERT, Manager::STMT_UPDATE => IObserver::UPDATE, Manager::STMT_DELETE => IObserver::DELETE )
#

Event type conversion table

Event type conversion table

protected array $subqueries array()
#
protected SplObjectStorage $observers
#
Neevo Public API API documentation generated by ApiGen 2.6.1