|
Fat-Free Framework
3.1.0 API Reference
|
Public Member Functions |
Public Attributes |
Protected Member Functions |
Protected Attributes |
List of all members
DB\SQL\Mapper Class Reference
SQL data mapper. More...
Inheritance diagram for DB\SQL\Mapper:
Public Member Functions | |
| exists ($key) | |
| set ($key, $val) | |
| get ($key) | |
| clear ($key) | |
| type ($pdo) | |
| value ($type, $val) | |
| 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) | |
| copyto ($key) | |
| schema () | |
| __construct (\DB\SQL $db, $table, $ttl=60) | |
Public Member Functions inherited from DB\Cursor | |
| 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 | |
| $engine | |
| Database engine. | |
| $table | |
| SQL table. | |
| $_id | |
| Last insert ID. | |
| $fields | |
| Defined fields. | |
| $adhoc =array() | |
| Adhoc fields. | |
| const | E_Adhoc ='Unable to process ad hoc field %s' |
Public Attributes inherited from DB\Cursor | |
| $ptr =0 | |
| Current position. | |
| const | E_Field ='Undefined field %s' |
Protected Member Functions | |
| factory ($row) | |
Protected Attributes | |
| $db | |
| PDO wrapper. | |
Protected Attributes inherited from DB\Cursor | |
| $query =array() | |
| Query results. | |
Detailed Description
SQL data mapper.
Constructor & Destructor Documentation
| DB\SQL\Mapper::__construct | ( | \DB\SQL | $db, |
| $table, | |||
$ttl = 60 |
|||
| ) |
Instantiate class
- Parameters
-
$db object $table string $ttl int
Member Function Documentation
| DB\SQL\Mapper::cast | ( | $obj = NULL) |
Return fields of mapper object as an associative array
- Returns
- array
- Parameters
-
$obj object
| DB\SQL\Mapper::clear | ( | $key) |
Clear value of field
- Returns
- NULL
- Parameters
-
$key string
| DB\SQL\Mapper::copyfrom | ( | $key) |
Hydrate mapper object using hive array variable
- Returns
- NULL
- Parameters
-
$key string
| DB\SQL\Mapper::copyto | ( | $key) |
Populate hive array variable with mapper fields
- Returns
- NULL
- Parameters
-
$key string
| DB\SQL\Mapper::count | ( | $filter = NULL, |
|
$ttl = 0 |
|||
| ) |
Count records that match criteria
- Returns
- int
- Parameters
-
$filter string|array $ttl int
| DB\SQL\Mapper::erase | ( | $filter = NULL) |
Delete current record
- Returns
- int
- Parameters
-
$filter string|array
| DB\SQL\Mapper::exists | ( | $key) |
Return TRUE if field is defined
- Returns
- bool
- Parameters
-
$key string
|
protected |
Convert array to mapper object
- Returns
- object
- Parameters
-
$row array
| 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
-
$key string
| DB\SQL\Mapper::insert | ( | ) |
Insert new record
- Returns
- array
| DB\SQL\Mapper::reset | ( | ) |
Reset cursor
- Returns
- NULL
| 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
-
$key string $val scalar
| 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
-
$ofs int
| DB\SQL\Mapper::type | ( | $pdo) |
Get PHP type equivalent of PDO constant
- Returns
- string
- Parameters
-
$pdo string
| DB\SQL\Mapper::update | ( | ) |
Update current record
- Returns
- array
| DB\SQL\Mapper::value | ( | $type, | |
| $val | |||
| ) |
Cast value to PHP type
- Returns
- scalar
- Parameters
-
$type string $val scalar
The documentation for this class was generated from the following file:
- db/sql/mapper.php
Generated on Mon Aug 19 2013 21:28:03 for Fat-Free Framework by
1.8.4
Public Member Functions inherited from