PHP Class DB\Jig\Mapper

Inheritance: extends DB\Cursor
Show file Open project: bcosca/fatfree-core Class Usage Examples

Protected Properties

Property Type Description
$db
$document
$file
$id

Public Methods

Method Description
__construct ( Jig $db, $file ) : void Instantiate class
cast ( $obj = NULL ) : array Return fields of mapper object as an associative array
clear ( $key ) : null Delete field
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
erase ( $filter = NULL ) : boolean Delete current record
exists ( $key ) : boolean Return TRUE if field is defined
fields ( ) : array Return field names
find ( $filter = NULL, array $options = NULL, $ttl, $log = TRUE ) : static[] | FALSE Return records that match criteria
get ( $key ) : scalar | FALSE Retrieve value of field
getiterator ( ) : object Retrieve external iterator for fields
insert ( ) : array Insert new record
reset ( ) : null Reset cursor
set ( $key, $val ) : scalar | FALSE Assign value to field
skip ( $ofs = 1 ) : array Return record at specified offset using criteria of previous load() call and make it active
token ( $str ) : string Convert tokens in string expression to variable names
update ( ) : array Update current record

Protected Methods

Method Description
factory ( $id, $row ) : object Convert array to mapper object

Method Details

__construct() public method

Instantiate class
public __construct ( Jig $db, $file ) : void
$db DB\Jig object
$file string
return void

cast() public method

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

clear() public method

Delete field
public clear ( $key ) : null
$key string
return null

copyfrom() public method

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

copyto() public method

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

count() public method

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

dbtype() public method

Return database type
public dbtype ( ) : string
return string

erase() public method

Delete current record
public erase ( $filter = NULL ) : boolean
$filter array
return boolean

exists() public method

Return TRUE if field is defined
public exists ( $key ) : boolean
$key string
return boolean

factory() protected method

Convert array to mapper object
protected factory ( $id, $row ) : object
$id string
$row array
return object

fields() public method

Return field names
public fields ( ) : array
return array

find() public method

Return records that match criteria
public find ( $filter = NULL, array $options = NULL, $ttl, $log = TRUE ) : static[] | FALSE
$filter array
$options array array
$ttl int
$log bool
return static[] | FALSE

get() public method

Retrieve value of field
public get ( $key ) : scalar | FALSE
$key string
return scalar | FALSE

getiterator() public method

Retrieve external iterator for fields
public getiterator ( ) : object
return object

insert() public method

Insert new record
public insert ( ) : array
return array

reset() public method

Reset cursor
public reset ( ) : null
return null

set() public method

Assign value to field
public set ( $key, $val ) : scalar | FALSE
$key string
$val scalar
return scalar | FALSE

skip() public method

Return record at specified offset using criteria of previous load() call and make it active
public skip ( $ofs = 1 ) : array
$ofs int
return array

token() public method

Convert tokens in string expression to variable names
public token ( $str ) : string
$str string
return string

update() public method

Update current record
public update ( ) : array
return array

Property Details

$db protected property

protected $db

$document protected property

protected $document

$file protected property

protected $file

$id protected property

protected $id