PHP Class DB\Cursor

Inheritance: extends Magic
Afficher le fichier Open project: bcosca/fatfree-core Class Usage Examples

Protected Properties

Свойство Type Description
$ptr @}
$query @}
$trigger @}

Méthodes publiques

Méthode 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 méthode

Define aftererase trigger
public aftererase ( $func ) : callback
$func callback
Résultat callback

afterinsert() public méthode

Define afterinsert trigger
public afterinsert ( $func ) : callback
$func callback
Résultat callback

aftersave() public méthode

Define aftersave trigger
public aftersave ( $func ) : callback
$func callback
Résultat callback

afterupdate() public méthode

Define afterupdate trigger
public afterupdate ( $func ) : callback
$func callback
Résultat callback

beforeerase() public méthode

Define beforeerase trigger
public beforeerase ( $func ) : callback
$func callback
Résultat callback

beforeinsert() public méthode

Define beforeinsert trigger
public beforeinsert ( $func ) : callback
$func callback
Résultat callback

beforesave() public méthode

Define beforesave trigger
public beforesave ( $func ) : callback
$func callback
Résultat callback

beforeupdate() public méthode

Define beforeupdate trigger
public beforeupdate ( $func ) : callback
$func callback
Résultat callback

cast() abstract public méthode

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

copyfrom() abstract public méthode

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

copyto() abstract public méthode

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

count() abstract public méthode

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

dbtype() abstract public méthode

Return database type
abstract public dbtype ( ) : string
Résultat string

dry() public méthode

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

erase() public méthode

Delete current record
public erase ( ) : integer | boolean
Résultat integer | boolean

fields() abstract public méthode

Return field names
abstract public fields ( ) : array
Résultat array

find() abstract public méthode

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
Résultat array

findone() public méthode

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
Résultat static | FALSE

first() public méthode

Map to first record in cursor
public first ( ) : mixed
Résultat mixed

getiterator() abstract public méthode

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 méthode

Insert new record
abstract public insert ( ) : array
Résultat array

last() public méthode

Map to last record in cursor
public last ( ) : mixed
Résultat mixed

load() public méthode

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
Résultat array | FALSE

loaded() public méthode

Return the count of records loaded
public loaded ( ) : integer
Résultat integer

next() public méthode

Map next record
public next ( ) : mixed
Résultat mixed

onerase() public méthode

Define onerase trigger
public onerase ( $func ) : callback
$func callback
Résultat callback

oninsert() public méthode

Define oninsert trigger
public oninsert ( $func ) : callback
$func callback
Résultat callback

onload() public méthode

Define onload trigger
public onload ( $func ) : callback
$func callback
Résultat callback

onsave() public méthode

Define onsave trigger
public onsave ( $func ) : callback
$func callback
Résultat callback

onupdate() public méthode

Define onupdate trigger
public onupdate ( $func ) : callback
$func callback
Résultat callback

paginate() public méthode

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
Résultat array

prev() public méthode

Map previous record
public prev ( ) : mixed
Résultat mixed

reset() public méthode

Reset cursor
public reset ( ) : null
Résultat null

save() public méthode

Save mapped record
public save ( ) : mixed
Résultat mixed

skip() public méthode

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

update() abstract public méthode

Update current record
abstract public update ( ) : array
Résultat array

valid() public méthode

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