SQL data mapper.
More...
|
| | dbtype () |
| |
| | exists ($key) |
| |
| | set ($key, $val) |
| |
| & | get ($key) |
| |
| | clear ($key) |
| |
| | type ($pdo) |
| |
| | cast ($obj=NULL) |
| |
| | select ($fields, $filter=NULL, array $options=NULL, $ttl=0) |
| |
| | find ($filter=NULL, array $options=NULL, $ttl=0) |
| |
| | count ($filter=NULL, $ttl=0) |
| |
| | skip ($ofs=1) |
| |
| | insert () |
| |
| | update () |
| |
| | erase ($filter=NULL) |
| |
| | reset () |
| |
| | copyfrom ($key, $func=NULL) |
| |
| | copyto ($key) |
| |
| | schema () |
| |
| | fields ($adhoc=TRUE) |
| |
| | getiterator () |
| |
| | __construct (\DB\SQL $db, $table, $fields=NULL, $ttl=60) |
| |
| | dbtype () |
| |
| | fields () |
| |
| | cast ($obj=NULL) |
| |
| | find ($filter=NULL, array $options=NULL, $ttl=0) |
| |
| | count ($filter=NULL, $ttl=0) |
| |
| | insert () |
| |
| | update () |
| |
| | copyfrom ($key, $func=NULL) |
| |
| | copyto ($key) |
| |
| | dry () |
| |
| | findone ($filter=NULL, array $options=NULL, $ttl=0) |
| |
| | paginate ($pos=0, $size=10, $filter=NULL, array $options=NULL, $ttl=0) |
| |
| | load ($filter=NULL, array $options=NULL, $ttl=0) |
| |
| | loaded () |
| |
| | first () |
| |
| | last () |
| |
| | skip ($ofs=1) |
| |
| | next () |
| |
| | prev () |
| |
| | valid () |
| |
| | save () |
| |
| | erase () |
| |
| | onload ($func) |
| |
| | beforeinsert ($func) |
| |
| | afterinsert ($func) |
| |
| | oninsert ($func) |
| |
| | beforeupdate ($func) |
| |
| | afterupdate ($func) |
| |
| | onupdate ($func) |
| |
| | beforesave ($func) |
| |
| | aftersave ($func) |
| |
| | onsave ($func) |
| |
| | beforeerase ($func) |
| |
| | aftererase ($func) |
| |
| | onerase ($func) |
| |
| | reset () |
| |
| | exists ($key) |
| |
| | set ($key, $val) |
| |
| & | get ($key) |
| |
| | clear ($key) |
| |
| | offsetexists ($key) |
| |
| | offsetset ($key, $val) |
| |
| & | offsetget ($key) |
| |
| | offsetunset ($key) |
| |
| | __isset ($key) |
| |
| | __set ($key, $val) |
| |
| & | __get ($key) |
| |
| | __unset ($key) |
| |
|
|
| $engine |
| | Database engine.
|
| |
|
| $source |
| | SQL table.
|
| |
|
| $table |
| | SQL table (quoted)
|
| |
|
| $_id |
| | Last insert ID.
|
| |
|
| $fields |
| | Defined fields.
|
| |
|
| $adhoc =array() |
| | Adhoc fields.
|
| |
|
|
const | E_Adhoc ='Unable to process ad hoc field %s' |
| |
|
| $ptr =0 |
| | Current position.
|
| |
|
| $trigger =array() |
| | Event listeners.
|
| |
|
const | E_Field ='Undefined field %s' |
| |
|
|
| $db |
| | PDO wrapper.
|
| |
|
| $query =array() |
| | Query results.
|
| |
| DB\SQL\Mapper::__construct |
( |
\DB\SQL |
$db, |
|
|
|
$table, |
|
|
|
$fields = NULL, |
|
|
|
$ttl = 60 |
|
) |
| |
Instantiate class
- Parameters
-
| $db | object |
| $table | string |
| $fields | array|string |
| $ttl | int |
| DB\SQL\Mapper::cast |
( |
|
$obj = NULL | ) |
|
Return fields of mapper object as an associative array
- Returns
- array
- Parameters
-
| DB\SQL\Mapper::clear |
( |
|
$key | ) |
|
Clear value of field
- Returns
- NULL
- Parameters
-
| DB\SQL\Mapper::copyfrom |
( |
|
$key, |
|
|
|
$func = NULL |
|
) |
| |
Hydrate mapper object using hive array variable
- Returns
- NULL
- Parameters
-
| DB\SQL\Mapper::copyto |
( |
|
$key | ) |
|
Populate hive array variable with mapper fields
- Returns
- NULL
- Parameters
-
| DB\SQL\Mapper::count |
( |
|
$filter = NULL, |
|
|
|
$ttl = 0 |
|
) |
| |
Count records that match criteria
- Returns
- int
- Parameters
-
| $filter | string|array |
| $ttl | int |
| DB\SQL\Mapper::dbtype |
( |
| ) |
|
Return database type
- Returns
- string
| DB\SQL\Mapper::erase |
( |
|
$filter = NULL | ) |
|
Delete current record
- Returns
- int
- Parameters
-
| DB\SQL\Mapper::exists |
( |
|
$key | ) |
|
Return TRUE if field is defined
- Returns
- bool
- Parameters
-
| DB\SQL\Mapper::factory |
( |
|
$row | ) |
|
|
protected |
Convert array to mapper object
- Returns
- object
- Parameters
-
| DB\SQL\Mapper::fields |
( |
|
$adhoc = TRUE | ) |
|
Return field names
- Returns
- array
- Parameters
-
| DB\SQL\Mapper::find |
( |
|
$filter = NULL, |
|
|
array |
$options = NULL, |
|
|
|
$ttl = 0 |
|
) |
| |
Return records that match criteria
- Returns
- array
- Parameters
-
| $filter | string|array |
| $options | array |
| $ttl | int |
| & DB\SQL\Mapper::get |
( |
|
$key | ) |
|
Retrieve value of field
- Returns
- scalar
- Parameters
-
| DB\SQL\Mapper::getiterator |
( |
| ) |
|
Retrieve external iterator for fields
- Returns
- object
| DB\SQL\Mapper::insert |
( |
| ) |
|
Insert new record
- Returns
- object
| DB\SQL\Mapper::schema |
( |
| ) |
|
Return schema
- Returns
- array
| DB\SQL\Mapper::select |
( |
|
$fields, |
|
|
|
$filter = NULL, |
|
|
array |
$options = NULL, |
|
|
|
$ttl = 0 |
|
) |
| |
Build query string and execute
- Returns
- array
- Parameters
-
| $fields | string |
| $filter | string|array |
| $options | array |
| $ttl | int |
| DB\SQL\Mapper::set |
( |
|
$key, |
|
|
|
$val |
|
) |
| |
Assign value to field
- Returns
- scalar
- Parameters
-
| DB\SQL\Mapper::skip |
( |
|
$ofs = 1 | ) |
|
Return record at specified offset using same criteria as previous load() call and make it active
- Returns
- array
- Parameters
-
| DB\SQL\Mapper::type |
( |
|
$pdo | ) |
|
Get PHP type equivalent of PDO constant
- Returns
- string
- Parameters
-
| DB\SQL\Mapper::update |
( |
| ) |
|
Update current record
- Returns
- object
The documentation for this class was generated from the following file: