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 Result

Represents a result. Can be iterated, counted and provides fluent interface.

Neevo\BaseStatement implements Neevo\IObservable
Extended by Neevo\Result implements IteratorAggregate, Countable
Namespace: Neevo
Author: Smasty
Located at Neevo/Result.php
Methods summary
public
# __construct( Neevo\Connection $connection, string|array|Traversable $columns = null, string|Neevo\Result $source = null )

Create SELECT statement.

Create SELECT statement.

Parameters

$connection
Neevo\Connection
$columns
string|array|Traversable
$source
string|Neevo\Result
Table name or subquery

Throws

InvalidArgumentException
public
# __destruct( )

Destroy the result set resource and free memory.

Destroy the result set resource and free memory.

public Neevo\Result
# group( string $rule, string $having = null )

Define grouping rule.

Define grouping rule.

Parameters

$rule
string
$having
string
Optional

Returns

Neevo\Result
fluent interface
public Neevo\Result
# join( string|Neevo\Result|Neevo\Literal $source, string|Neevo\Literal $condition )

Perform JOIN on tables.

Perform JOIN on tables.

Parameters

$source
string|Neevo\Result|Neevo\Literal
Table name or subquery
$condition
string|Neevo\Literal

Returns

Neevo\Result
fluent interface
public Neevo\Result
# leftJoin( string|Neevo\Result|Neevo\Literal $source, string|Neevo\Literal $condition )

Perform LEFT JOIN on tables.

Perform LEFT JOIN on tables.

Parameters

$source
string|Neevo\Result|Neevo\Literal
Table name or subquery
$condition
string|Neevo\Literal

Returns

Neevo\Result
fluent interface
public Neevo\Result
# innerJoin( string|Neevo\Result|Neevo\Literal $source, string|Neevo\Literal $condition )

Perform INNER JOIN on tables.

Perform INNER JOIN on tables.

Parameters

$source
string|Neevo\Result|Neevo\Literal
Table name or subquery
$condition
string|Neevo\Literal

Returns

Neevo\Result
fluent interface
public Neevo\Result
# page( integer $page, integer $items )

Adjust the LIMIT and OFFSET clauses according to defined page number and number of items per page.

Adjust the LIMIT and OFFSET clauses according to defined page number and number of items per page.

Parameters

$page
integer
Page number
$items
integer
Number of items per page

Returns

Neevo\Result
fluent interface

Throws

InvalidArgumentException
public Neevo\Row|false
# fetch( )

Fetch the row on current position.

Fetch the row on current position.

Returns

Neevo\Row|false
public Neevo\Row[]
# fetchAll( integer $limit = null, integer $offset = null )

Fetch all rows in result set.

Fetch all rows in result set.

Parameters

$limit
integer
Limit number of returned rows
$offset
integer
Seek to offset (fails on unbuffered results)

Returns

Neevo\Row[]
public mixed
# fetchSingle( )

Fetch the first value from current row.

Fetch the first value from current row.

Returns

mixed
public Neevo\Row[]
# fetchPairs( string $key, string $value = null )

Fetch rows as $key=>$value pairs.

Fetch rows as $key=>$value pairs.

Parameters

$key
string
Key column
$value
string
Value column. NULL for whole row.

Returns

Neevo\Row[]
public boolean
# seek( integer $offset )

Move internal result pointer.

Move internal result pointer.

Parameters

$offset
integer

Returns

boolean

Throws

Neevo\NeevoException
public
# rows( )
public integer
# count( string $column = null )

Count number of rows.

Count number of rows.

Parameters

$column
string

Returns

integer

Throws

Neevo\DriverException

Implementation of

Countable::count
public mixed
# aggregation( string $function )

Execute aggregation function.

Execute aggregation function.

Parameters

$function
string

Returns

mixed
public mixed
# sum( string $column )

Get the sum of column values.

Get the sum of column values.

Parameters

$column
string

Returns

mixed
public mixed
# min( string $column )

Get the minimum value of column.

Get the minimum value of column.

Parameters

$column
string

Returns

mixed
public mixed
# max( string $column )

Get the maximum value of column.

Get the maximum value of column.

Parameters

$column
string

Returns

mixed
public array
# explain( )

Explain performed query.

Explain performed query.

Returns

array
public Neevo\Result
# setType( string $column, string $type )

Set column type.

Set column type.

Parameters

$column
string
$type
string

Returns

Neevo\Result
fluent interface
public Neevo\Result
# setTypes( array|Traversable $types )

Set multiple column types at once.

Set multiple column types at once.

Parameters

$types
array|Traversable

Returns

Neevo\Result
fluent interface
public Neevo\Result
# detectTypes( )

Detect column types.

Detect column types.

Returns

Neevo\Result
fluent interface
protected string
# resolveType( string $type )

Resolve vendor column type.

Resolve vendor column type.

Parameters

$type
string

Returns

string
protected mixed
# convertType( mixed $value, string $type )

Convert value to a specified type.

Convert value to a specified type.

Parameters

$value
mixed
$type
string

Returns

mixed
public Neevo\Result
# setAlias( string $alias )

Set table alias to be used when in subquery.

Set table alias to be used when in subquery.

Parameters

$alias
string

Returns

Neevo\Result
fluent interface
public string|null
# getAlias( )

Get table alias used in subquery.

Get table alias used in subquery.

Returns

string|null
public Neevo\Result
# setRowClass( string $className )

Set class to use as a row class.

Set class to use as a row class.

Parameters

$className
string

Returns

Neevo\Result
fluent interface

Throws

Neevo\NeevoException
public Neevo\ResultIterator
# getIterator( )

Get the result iterator.

Get the result iterator.

Returns

Neevo\ResultIterator

Implementation of

IteratorAggregate::getIterator
public
# getGrouping( )
public
# getColumns( )
public
# getJoins( )
public string|null
# getTable( )

Get full table name (with prefix) if available.

Get full table name (with prefix) if available.

Returns

string|null
public string|Neevo\Result
# getSource( )

Get the source for the statement.

Get the source for the statement.

Returns

string|Neevo\Result
Methods inherited from Neevo\BaseStatement
__clone(), __toString(), attachObserver(), detachObserver(), dump(), exec(), getConditions(), getConnection(), getLimit(), getPrimaryKey(), getSorting(), getTime(), getType(), hasCircularReferences(), isPerformed(), limit(), notifyObservers(), order(), rand(), resetState(), run(), validateConditions(), where()
Properties summary
protected string $grouping
#
protected array $columns array()
#
protected array $joins
#
protected string $tableAlias
#
protected resource $resultSet
#
protected array $columnTypes array()
#
protected boolean $detectTypes
#
Properties inherited from Neevo\BaseStatement
$conditions, $connection, $eventTable, $limit, $observers, $offset, $performed, $sorting, $source, $subqueries, $time, $type
Neevo Public API API documentation generated by ApiGen 2.6.1