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 Result

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

Neevo\BaseStatement implements Neevo\ObservableInterface
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 )

Creates SELECT statement.

Creates SELECT statement.

Parameters

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

Throws

InvalidArgumentException

Overrides

Neevo\BaseStatement::__construct
public
# __destruct( )

Destroys the result set resource and free memory.

Destroys the result set resource and free memory.

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

Defines grouping rule.

Defines grouping rule.

Parameters

$rule
string
$rule
$having
string
$having Optional

Returns

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

Performs JOIN on tables.

Performs JOIN on tables.

Parameters

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

Returns

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

Performs LEFT JOIN on tables.

Performs LEFT JOIN on tables.

Parameters

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

Returns

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

Performs INNER JOIN on tables.

Performs INNER JOIN on tables.

Parameters

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

Returns

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

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

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

Parameters

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

Returns

Neevo\Result
fluent interface

Throws

InvalidArgumentException
public Neevo\Row|boolean
# fetch( )

Fetches the row on current position.

Fetches the row on current position.

Returns

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

Fetches all rows in result set.

Fetches all rows in result set.

Parameters

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

Returns

Neevo\Row[]
public mixed
# fetchSingle( )

Fetches the first value from current row.

Fetches the first value from current row.

Returns

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

Fetches rows as $key=>$value pairs.

Fetches rows as $key=>$value pairs.

Parameters

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

Returns

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

Moves internal result pointer.

Moves internal result pointer.

Parameters

$offset
integer
$offset

Returns

boolean

Throws

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

Counts number of rows.

Counts number of rows.

Parameters

$column
string
$column

Returns

integer

Throws

Neevo\DriverException

Implementation of

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

Executes aggregation function.

Executes aggregation function.

Parameters

$function
string
$function

Returns

mixed
public mixed
# sum( string $column )

Returns the sum of column values.

Returns the sum of column values.

Parameters

$column
string
$column

Returns

mixed
public mixed
# min( string $column )

Returns the minimum value of column.

Returns the minimum value of column.

Parameters

$column
string
$column

Returns

mixed
public mixed
# max( string $column )

Returns the maximum value of column.

Returns the maximum value of column.

Parameters

$column
string
$column

Returns

mixed
public array
# explain( )

Explains performed query.

Explains performed query.

Returns

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

Sets column type.

Sets column type.

Parameters

$column
string
$column
$type
string
$type

Returns

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

Sets multiple column types at once.

Sets multiple column types at once.

Parameters

$types
array|Traversable
$types

Returns

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

Detects column types.

Detects column types.

Returns

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

Resolves vendor column type.

Resolves vendor column type.

Parameters

$type
string
$type

Returns

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

Converts value to a specified type.

Converts value to a specified type.

Parameters

$value
mixed
$value
$type
string
$type

Returns

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

Sets table alias to be used when in subquery.

Sets table alias to be used when in subquery.

Parameters

$alias
string
$alias

Returns

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

Returns table alias used in subquery.

Returns table alias used in subquery.

Returns

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

Sets class to use as a row class.

Sets class to use as a row class.

Parameters

$className
string
$className

Returns

Neevo\Result
fluent interface

Throws

Neevo\NeevoException
public Neevo\ResultIterator
# getIterator( )

Returns the result iterator.

Returns the result iterator.

Returns

Neevo\ResultIterator

Implementation of

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

Returns full table name (with prefix) if available.

Returns full table name (with prefix) if available.

Returns

string|null

Overrides

Neevo\BaseStatement::getTable
public string|Neevo\Result
# getSource( )

Returns the source for the statement.

Returns 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()

Magic methods summary

public Neevo\Result
# as( mixed $alias = )

Parameters

$alias
mixed
$alias

Returns

Neevo\Result

Magic methods inherited from Neevo\BaseStatement

and(), else(), end(), if(), or()

Properties summary

protected string $grouping
#
protected array $columns
#
protected array $joins
#
protected string $tableAlias
#
protected resource $resultSet
#
protected array $columnTypes
#
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.8.0