PHP Class DB\Cursor

Inheritance: extends Magic
Datei anzeigen Open project: bcosca/fatfree-core Class Usage Examples

Protected Properties

Property Type Description
$ptr @}
$query @}
$trigger @}

Public Methods

Method Description
aftererase ( $func ) : callback Define aftererase trigger
afterinsert ( $func ) : callback Define afterinsert trigger
aftersave ( $func ) : callback Define aftersave trigger
afterupdate ( $func ) : callback Define afterupdate trigger
beforeerase ( $func ) : callback Define beforeerase trigger
beforeinsert ( $func ) : callback Define beforeinsert trigger
beforesave ( $func ) : callback Define beforesave trigger
beforeupdate ( $func ) : callback Define beforeupdate trigger
cast ( $obj = NULL ) : array Return fields of mapper object as an associative array
copyfrom ( $var, $func = NULL ) : null Hydrate mapper object using hive array variable
copyto ( $key ) : null Populate hive array variable with mapper fields
count ( $filter = NULL, $ttl ) : integer Count records that match criteria
dbtype ( ) : string Return database type
dry ( ) : boolean Return TRUE if current cursor position is not mapped to any record
erase ( ) : integer | boolean Delete current record
fields ( ) : array Return field names
find ( $filter = NULL, array $options = NULL, $ttl ) : array Return records (array of mapper objects) that match criteria
findone ( $filter = NULL, array $options = NULL, $ttl ) : static | FALSE Return first record (mapper object) that matches criteria
first ( ) : mixed Map to first record in cursor
getiterator ( ) Get cursor's equivalent external iterator Causes a fatal error in PHP 5.3.5 if uncommented return ArrayIterator
insert ( ) : array Insert new record
last ( ) : mixed Map to last record in cursor
load ( $filter = NULL, array $options = NULL, $ttl ) : array | FALSE Map to first record that matches criteria
loaded ( ) : integer Return the count of records loaded
next ( ) : mixed Map next record
onerase ( $func ) : callback Define onerase trigger
oninsert ( $func ) : callback Define oninsert trigger
onload ( $func ) : callback Define onload trigger
onsave ( $func ) : callback Define onsave trigger
onupdate ( $func ) : callback Define onupdate trigger
paginate ( $pos, $size = 10, $filter = NULL, array $options = NULL, $ttl ) : array Return array containing subset of records matching criteria, total number of records in superset, specified limit, number of subsets available, and actual subset position
prev ( ) : mixed Map previous record
reset ( ) : null Reset cursor
save ( ) : mixed Save mapped record
skip ( $ofs = 1 ) : mixed Map to nth record relative to current cursor position
update ( ) : array Update current record
valid ( ) Return whether current iterator position is valid.

Method Details

aftererase() public method

Define aftererase trigger
public aftererase ( $func ) : callback
$func callback
return callback

afterinsert() public method

Define afterinsert trigger
public afterinsert ( $func ) : callback
$func callback
return callback

aftersave() public method

Define aftersave trigger
public aftersave ( $func ) : callback
$func callback
return callback

afterupdate() public method

Define afterupdate trigger
public afterupdate ( $func ) : callback
$func callback
return callback

beforeerase() public method

Define beforeerase trigger
public beforeerase ( $func ) : callback
$func callback
return callback

beforeinsert() public method

Define beforeinsert trigger
public beforeinsert ( $func ) : callback
$func callback
return callback

beforesave() public method

Define beforesave trigger
public beforesave ( $func ) : callback
$func callback
return callback

beforeupdate() public method

Define beforeupdate trigger
public beforeupdate ( $func ) : callback
$func callback
return callback

cast() abstract public method

Return fields of mapper object as an associative array
abstract public cast ( $obj = NULL ) : array
$obj object
return array

copyfrom() abstract public method

Hydrate mapper object using hive array variable
abstract public copyfrom ( $var, $func = NULL ) : null
$var array|string
$func callback
return null

copyto() abstract public method

Populate hive array variable with mapper fields
abstract public copyto ( $key ) : null
$key string
return null

count() abstract public method

Count records that match criteria
abstract public count ( $filter = NULL, $ttl ) : integer
$filter array
$ttl int
return integer

dbtype() abstract public method

Return database type
abstract public dbtype ( ) : string
return string

dry() public method

Return TRUE if current cursor position is not mapped to any record
public dry ( ) : boolean
return boolean

erase() public method

Delete current record
public erase ( ) : integer | boolean
return integer | boolean

fields() abstract public method

Return field names
abstract public fields ( ) : array
return array

find() abstract public method

Return records (array of mapper objects) that match criteria
abstract public find ( $filter = NULL, array $options = NULL, $ttl ) : array
$filter string|array
$options array array
$ttl int
return array

findone() public method

Return first record (mapper object) that matches criteria
public findone ( $filter = NULL, array $options = NULL, $ttl ) : static | FALSE
$filter string|array
$options array array
$ttl int
return static | FALSE

first() public method

Map to first record in cursor
public first ( ) : mixed
return mixed

getiterator() abstract public method

Get cursor's equivalent external iterator Causes a fatal error in PHP 5.3.5 if uncommented return ArrayIterator
abstract public getiterator ( )

insert() abstract public method

Insert new record
abstract public insert ( ) : array
return array

last() public method

Map to last record in cursor
public last ( ) : mixed
return mixed

load() public method

Map to first record that matches criteria
public load ( $filter = NULL, array $options = NULL, $ttl ) : array | FALSE
$filter string|array
$options array array
$ttl int
return array | FALSE

loaded() public method

Return the count of records loaded
public loaded ( ) : integer
return integer

next() public method

Map next record
public next ( ) : mixed
return mixed

onerase() public method

Define onerase trigger
public onerase ( $func ) : callback
$func callback
return callback

oninsert() public method

Define oninsert trigger
public oninsert ( $func ) : callback
$func callback
return callback

onload() public method

Define onload trigger
public onload ( $func ) : callback
$func callback
return callback

onsave() public method

Define onsave trigger
public onsave ( $func ) : callback
$func callback
return callback

onupdate() public method

Define onupdate trigger
public onupdate ( $func ) : callback
$func callback
return callback

paginate() public method

Return array containing subset of records matching criteria, total number of records in superset, specified limit, number of subsets available, and actual subset position
public paginate ( $pos, $size = 10, $filter = NULL, array $options = NULL, $ttl ) : array
$pos int
$size int
$filter string|array
$options array array
$ttl int
return array

prev() public method

Map previous record
public prev ( ) : mixed
return mixed

reset() public method

Reset cursor
public reset ( ) : null
return null

save() public method

Save mapped record
public save ( ) : mixed
return mixed

skip() public method

Map to nth record relative to current cursor position
public skip ( $ofs = 1 ) : mixed
$ofs int
return mixed

update() abstract public method

Update current record
abstract public update ( ) : array
return array

valid() public method

Return whether current iterator position is valid.
public valid ( )

Property Details

$ptr protected_oe property

@}
protected $ptr

$query protected_oe property

@}
protected $query

$trigger protected_oe property

@}
protected $trigger