Fat-Free Framework: DB\Cursor Class Reference

Fat-Free-Framework

Fat-Free Framework  3.1.0 API Reference

Simple cursor implementation. More...

Inheritance diagram for DB\Cursor:
Magic DB\Jig\Mapper DB\Mongo\Mapper DB\SQL\Mapper DB\Jig\Session DB\Mongo\Session DB\SQL\Session

Public Member Functions

 find ($filter=NULL, array $options=NULL)
 
 insert ()
 
 update ()
 
 dry ()
 
 findone ($filter=NULL, array $options=NULL, $ttl=0)
 
 paginate ($pos=0, $size=10, $filter=NULL, array $options=NULL)
 
 load ($filter=NULL, array $options=NULL)
 
 first ()
 
 last ()
 
 skip ($ofs=1)
 
 next ()
 
 prev ()
 
 save ()
 
 erase ()
 
 reset ()
 
- Public Member Functions inherited from Magic
 exists ($key)
 
 set ($key, $val)
 
 get ($key)
 
 clear ($key)
 
 offsetexists ($key)
 
 __isset ($key)
 
 offsetset ($key, $val)
 
 __set ($key, $val)
 
 offsetget ($key)
 
 __get ($key)
 
 offsetunset ($key)
 
 __unset ($key)
 

Public Attributes

 $ptr =0
 Current position.
 
const E_Field ='Undefined field %s'
 

Protected Attributes

 $query =array()
 Query results.
 

Detailed Description

Simple cursor implementation.

Member Function Documentation

DB\Cursor::dry ( )

Return TRUE if current cursor position is not mapped to any record

Returns
bool
DB\Cursor::erase ( )

Delete current record

Returns
int|bool
DB\Cursor::find (   $filter = NULL,
array  $options = NULL 
)
abstract

Return records (array of mapper objects) that match criteria

Returns
array
Parameters
$filterstring|array
$optionsarray
DB\Cursor::findone (   $filter = NULL,
array  $options = NULL,
  $ttl = 0 
)

Return first record (mapper object) that matches criteria

Returns
object|FALSE
Parameters
$filterstring|array
$optionsarray
$ttlint
DB\Cursor::first ( )

Map to first record in cursor

Returns
mixed
DB\Cursor::insert ( )
abstract

Insert new record

Returns
array
DB\Cursor::last ( )

Map to last record in cursor

Returns
mixed
DB\Cursor::load (   $filter = NULL,
array  $options = NULL 
)

Map to first record that matches criteria

Returns
array|FALSE
Parameters
$filterstring|array
$optionsarray
DB\Cursor::next ( )

Map next record

Returns
mixed
DB\Cursor::paginate (   $pos = 0,
  $size = 10,
  $filter = NULL,
array  $options = NULL 
)

Return array containing subset of records matching criteria, total number of records in superset, number of subsets available, and actual subset position

Returns
array
Parameters
$posint
$sizeint
$filterstring|array
$optionsarray
DB\Cursor::prev ( )

Map previous record

Returns
mixed
DB\Cursor::reset ( )

Reset cursor

Returns
NULL
DB\Cursor::save ( )

Save mapped record

Returns
mixed
DB\Cursor::skip (   $ofs = 1)

Map to nth record relative to current cursor position

Returns
mixed
Parameters
$ofsint
DB\Cursor::update ( )
abstract

Update current record

Returns
array

The documentation for this class was generated from the following file:
  • db/cursor.php
Generated on Mon Aug 19 2013 21:27:59 for Fat-Free Framework by   doxygen 1.8.4