Neevo Public API
  • Namespace
  • Class
  • Tree

Namespaces

  • Neevo
    • Nette
  • None
  • PHP

Classes

  • Neevo
  • NeevoBaseStmt
  • NeevoCacheFile
  • NeevoCacheMemcache
  • NeevoCacheMemory
  • NeevoCacheSession
  • NeevoConnection
  • NeevoDriverMySQL
  • NeevoDriverMySQLi
  • NeevoDriverPgSQL
  • NeevoDriverSQLite2
  • NeevoDriverSQLite3
  • NeevoLiteral
  • NeevoLoader
  • NeevoObserverMap
  • NeevoParser
  • NeevoResult
  • NeevoResultIterator
  • NeevoRow
  • NeevoStmt

Interfaces

  • INeevoCache
  • INeevoDriver
  • INeevoObservable
  • INeevoObserver

Exceptions

  • NeevoDriverException
  • NeevoException
  • NeevoImplementationException

Class NeevoResult

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

NeevoBaseStmt implements INeevoObservable
Extended by NeevoResult implements IteratorAggregate, Countable
Package: Neevo
Author: Martin Srank
Located at neevo/NeevoResult.php

Methods summary

public
# __construct( NeevoConnection $connection, string|array|Traversable $columns = null, string|NeevoResult $source = null )

Create SELECT statement.

Create SELECT statement.

Parameters

$connection
NeevoConnection
$connection
$columns
string|array|Traversable
$columns
$source
string|NeevoResult
$source Table name or subquery

Throws

InvalidArgumentException

Overrides

NeevoBaseStmt::__construct
public
# __destruct( )

Destroy the result set resource and free memory.

Destroy the result set resource and free memory.

public NeevoResult
# group( string $rule, string $having = null )

Define grouping rule.

Define grouping rule.

Parameters

$rule
string
$rule
$having
string
$having Optional

Returns

NeevoResult
fluent interface
public NeevoResult
# join( string|NeevoResult|NeevoLiteral $source, string|NeevoLiteral $condition )

Perform JOIN on tables.

Perform JOIN on tables.

Parameters

$source
string|NeevoResult|NeevoLiteral
$source Table name or subquery
$condition
string|NeevoLiteral
$condition

Returns

NeevoResult
fluent interface
public NeevoResult
# leftJoin( string|NeevoResult|NeevoLiteral $source, string|NeevoLiteral $condition )

Perform LEFT JOIN on tables.

Perform LEFT JOIN on tables.

Parameters

$source
string|NeevoResult|NeevoLiteral
$source Table name or subquery
$condition
string|NeevoLiteral
$condition

Returns

NeevoResult
fluent interface
public NeevoResult
# innerJoin( string|NeevoResult|NeevoLiteral $source, string|NeevoLiteral $condition )

Perform INNER JOIN on tables.

Perform INNER JOIN on tables.

Parameters

$source
string|NeevoResult|NeevoLiteral
$source Table name or subquery
$condition
string|NeevoLiteral
$condition

Returns

NeevoResult
fluent interface
public NeevoRow|false
# fetch( )

Fetch the row on current position.

Fetch the row on current position.

Returns

NeevoRow|false
public array
# fetchAll( integer $limit = null, integer $offset = null )

Fetch all rows in result set.

Fetch 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

array
public mixed
# fetchSingle( )

Fetch the first value from current row.

Fetch the first value from current row.

Returns

mixed
public array
# fetchPairs( string $key, string $value = null )

Fetch rows as $key=>$value pairs.

Fetch rows as $key=>$value pairs.

Parameters

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

Returns

array
public boolean
# seek( integer $offset )

Move internal result pointer.

Move internal result pointer.

Parameters

$offset
integer
$offset

Returns

boolean

Throws

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

Count number of rows.

Count number of rows.

Parameters

$column
string
$column

Returns

integer

Throws

NeevoDriverException

Implementation of

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

Execute aggregation function.

Execute aggregation function.

Parameters

$function
string
$function

Returns

mixed
public mixed
# sum( string $column )

Get the sum of column values.

Get the sum of column values.

Parameters

$column
string
$column

Returns

mixed
public mixed
# min( string $column )

Get the minimum value of column.

Get the minimum value of column.

Parameters

$column
string
$column

Returns

mixed
public mixed
# max( string $column )

Get the maximum value of column.

Get the maximum value of column.

Parameters

$column
string
$column

Returns

mixed
public array
# explain( )

Explain performed query.

Explain performed query.

Returns

array
public NeevoResult
# setType( string $column, string $type )

Set column type.

Set column type.

Parameters

$column
string
$column
$type
string
$type

Returns

NeevoResult
fluent interface
public NeevoResult
# setTypes( array|Traversable $types )

Set multiple column types at once.

Set multiple column types at once.

Parameters

$types
array|Traversable
$types

Returns

NeevoResult
fluent interface
public NeevoResult
# detectTypes( )

Detect column types.

Detect column types.

Returns

NeevoResult
fluent interface
protected string
# resolveType( string $type )

Resolve vendor column type.

Resolve vendor column type.

Parameters

$type
string
$type

Returns

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

Convert value to a specified type.

Convert value to a specified type.

Parameters

$value
mixed
$value
$type
string
$type

Returns

mixed
public NeevoResult
# setAlias( string $alias )

Set table alias to be used when in subquery.

Set table alias to be used when in subquery.

Parameters

$alias
string
$alias

Returns

NeevoResult
fluent interface
public string|null
# getAlias( )

Get table alias used in subquery.

Get table alias used in subquery.

Returns

string|null
public NeevoResult
# setRowClass( string $className )

Set class to use as a row class.

Set class to use as a row class.

Parameters

$className
string
$className

Returns

NeevoResult
fluent interface

Throws

NeevoException
public NeevoResultIterator
# getIterator( )

Get the result iterator.

Get the result iterator.

Returns

NeevoResultIterator

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

Overrides

NeevoBaseStmt::getTable
public string|NeevoResult
# getSource( )

Get the source for the statement.

Get the source for the statement.

Returns

string|NeevoResult

Methods inherited from NeevoBaseStmt

__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 NeevoResult
# as( mixed $alias = )

Parameters

$alias
mixed
$alias

Returns

NeevoResult

Magic methods inherited from NeevoBaseStmt

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 NeevoBaseStmt

$conditions, $connection, $eventTable, $limit, $observers, $offset, $performed, $sorting, $source, $subqueries, $time, $type

Neevo Public API API documentation generated by ApiGen 2.8.0