Neevo Public API
  • Namespace
  • Class
  • Tree

Namespaces

  • Neevo
    • Cache
    • Drivers
    • Nette
  • PHP

Classes

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

Interfaces

  • DriverInterface
  • ObservableInterface
  • ObserverInterface

Exceptions

  • DriverException
  • ImplementationException
  • NeevoException

Class BaseStatement

Neevo statement abstract base ancestor.

Neevo\BaseStatement implements Neevo\ObservableInterface

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
$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 )

Sets WHERE condition. Accepts infinite arguments.

Sets 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
$expr
$value
mixed
$value

Returns

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

Defines order. More calls append rules.

Defines order. More calls append rules.

Parameters

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

Returns

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

Sets LIMIT and OFFSET clauses.

Sets LIMIT and OFFSET clauses.

Parameters

$limit
integer
$limit
$offset
integer
$offset

Returns

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

Randomizes order. Removes any other order clause.

Randomizes order. Removes any other order clause.

Returns

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

Prints out syntax highlighted statement.

Prints out syntax highlighted statement.

Parameters

$return
boolean
$return

Returns

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

Performs the statement.

Performs the statement.

Returns

resource|boolean
public resource|boolean
# exec( )

Performs the statement. Alias for run().

Performs the statement. Alias for run().

Returns

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

Attaches given observer to given event.

Attaches given observer to given event.

Parameters

$observer
Neevo\ObserverInterface
$observer
$event
integer
$event

Implementation of

Neevo\ObservableInterface::attachObserver()
public
# detachObserver( Neevo\ObserverInterface $observer )

Detaches given observer.

Detaches given observer.

Parameters

$observer
Neevo\ObserverInterface
$observer

Implementation of

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

Notifies all observers attached to given event.

Notifies all observers attached to given event.

Parameters

$event
integer
$event

Implementation of

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

Returns query execution time.

Returns query execution time.

Returns

integer
public boolean
# isPerformed( )

Returns wheter query was performed.

Returns wheter query was performed.

Returns

boolean
public string
# getTable( )

Returns full table name (with prefix).

Returns full table name (with prefix).

Returns

string
public string
# getType( )

Returns tatement type.

Returns tatement type.

Returns

string
public array
# getLimit( )

Returns LIMIT and OFFSET clauses.

Returns LIMIT and OFFSET clauses.

Returns

array
public array
# getConditions( )

Returns statement WHERE clause.

Returns statement WHERE clause.

Returns

array
public array
# getSorting( )

Returns statement ORDER BY clause.

Returns statement ORDER BY clause.

Returns

array
public string|null
# getPrimaryKey( )

Returns the name of the PRIMARY KEY column.

Returns the name of the PRIMARY KEY column.

Returns

string|null
public Neevo\Connection
# getConnection( )

Returns the connection instance.

Returns the connection instance.

Returns

Neevo\Connection
protected
# resetState( )

Resets the state of the statement.

Resets the state of the statement.

protected boolean
# validateConditions( )

Validates the current statement condition.

Validates the current statement condition.

Returns

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

Checks the query tree for circular references.

Checks the query tree for circular references.

Parameters

$parent
Neevo\BaseStatement
$parent
$visited
array
$visited

Returns

boolean
True if circular reference found.

Magic methods summary

public Neevo\BaseStatement
# and( mixed $expr = , mixed $value = true )

Parameters

$expr
mixed
$expr
$value
mixed
$value

Returns

Neevo\BaseStatement
public Neevo\BaseStatement
# or( mixed $expr = , mixed $value = true )

Parameters

$expr
mixed
$expr
$value
mixed
$value

Returns

Neevo\BaseStatement
public Neevo\BaseStatement
# if( mixed $condition = )

Parameters

$condition
mixed
$condition

Returns

Neevo\BaseStatement
public Neevo\BaseStatement
# else( )

Returns

Neevo\BaseStatement
public Neevo\BaseStatement
# end( )

Returns

Neevo\BaseStatement

Properties summary

protected string $source
#
protected string $type
#
protected integer $limit
#
protected integer $offset
#
protected array $conditions
#
protected array $sorting
#
protected float $time
#
protected boolean $performed
#
protected Neevo\Connection $connection
#
protected static array $eventTable
#

Event type conversion table

Event type conversion table

protected array $subqueries
#
protected SplObjectStorage $observers
#
Neevo Public API API documentation generated by ApiGen 2.8.0