\LtDbTableDataGateway

Database Table abstract

Summary

Methods
Properties
Constants
count()
delete()
deleteRows()
fetch()
fetchRows()
insert()
update()
updateRows()
$configHandle
$dbh
$createdColumn
$modifiedColumn
$tableName
No constants found
buildFieldList()
$fields
$primaryKey
$servers
N/A
No private methods found
No private properties found
N/A

Properties

$configHandle

$configHandle : 

Type

$dbh

$dbh : 

Type

$createdColumn

$createdColumn : string

The created field name

Type

string

$modifiedColumn

$modifiedColumn : string

The modified field name

Type

string

$tableName

$tableName : string

The table name

Type

string

$fields

$fields : array

The fields array

Type

array

$primaryKey

$primaryKey : string

The primary key

Type

string

$servers

$servers : 

Type

Methods

count()

count(array  $args = null) : integer

A shortcut to SELECT COUNT(*) FROM table WHERE condition

Parameters

array $args

Returns

integer

Examples

=> 'id < :id', 'value' => array('id' => 10)));
** File not found : count(array('expression' **

delete()

delete(string  $primaryKeyId) : string

Delete a row by primary key

Parameters

string $primaryKeyId

Returns

string

Examples

** File not found : delete(10); **

deleteRows()

deleteRows(array  $args = null) : integer

Delete many rows from table Please use this method carefully!

Parameters

array $args

Returns

integer

Examples

=> "id > :id", 'value' => array('id' => 2)));
** File not found : deleteRows(array('expression' **

fetch()

fetch(string  $primaryKeyId, array  $args = null, boolean  $useSlave = true) : array

Fetch one row from table by primary key

Parameters

string $primaryKeyId
array $args
boolean $useSlave

Returns

array

Examples

** File not found : fetch(10) **

fetchRows()

fetchRows(array  $args = null, boolean  $useSlave = true) : array

Fetch many rows from table

Parameters

array $args
boolean $useSlave

Returns

array

Examples

=> array('expression' => "id > :id", 'value' => array('id' => 2))));
** File not found : fetchRows(array('where' **

insert()

insert(array  $args = null) : string

Insert one row into table, then return the inserted row's pk

Parameters

array $args

Returns

string

Examples

=> 'lily', 'age' => '12'));
** File not found : insert(array('name' **

update()

update(string  $primaryKeyId, array  $args = null) : integer

Update one row by primary key

Parameters

string $primaryKeyId
array $args

Returns

integer

Examples

array('name' => 'lily', 'age' => '18'));
** File not found : update(1, **

updateRows()

updateRows(array  $where, array  $args = null) : integer

Update manay rows Please use this method carefully!

Parameters

array $where
array $args

Returns

integer

Examples

=> "id > :id", 'value' => array('id' => 2)), array('name' => 'kiwi', 'age' => '1'));
** File not found : updateRows(array('expression' **

buildFieldList()

buildFieldList() : array

Build table's field list

Returns

array