\Pop\Db\GatewayTable

Table gateway class

Summary

Methods
Properties
Constants
__construct()
setTable()
setPrimaryKeys()
getSql()
sql()
getTable()
getPrimaryKeys()
getTableInfo()
getNumberOfRows()
getRows()
rows()
select()
insert()
update()
delete()
No public properties found
No constants found
getOrder()
$table
$primaryKeys
$sql
$rows
N/A
No private methods found
No private properties found
N/A

Properties

$table

$table : string

Table

Type

string

$primaryKeys

$primaryKeys : array

Primary keys

Type

array

$rows

$rows : array

Result rows

Type

array

Methods

__construct()

__construct(\Pop\Db\Sql  $sql, string  $table = null) : \Pop\Db\Gateway\AbstractGateway

Constructor

Instantiate the AbstractGateway object.

Parameters

\Pop\Db\Sql $sql
string $table

Returns

\Pop\Db\Gateway\AbstractGateway

setPrimaryKeys()

setPrimaryKeys(mixed  $keys) : \Pop\Db\Gateway\AbstractGateway

Set the primary keys

Parameters

mixed $keys

Returns

\Pop\Db\Gateway\AbstractGateway

getSql()

getSql() : \Pop\Db\Sql

Get the SQL object

Returns

\Pop\Db\Sql

sql()

sql() : \Pop\Db\Sql

Get the SQL object (alias method)

Returns

\Pop\Db\Sql

getTable()

getTable() : string

Get the table name

Returns

string

getPrimaryKeys()

getPrimaryKeys() : array

Get the primary keys

Returns

array

getTableInfo()

getTableInfo() : array

Get table info

Returns

array

getNumberOfRows()

getNumberOfRows() : integer

Get the number of result rows

Returns

integer

getRows()

getRows() : array

Get the result rows

Returns

array

rows()

rows() : array

Get the result rows (alias method)

Returns

array

select()

select(array  $columns = null, mixed  $where = null, array  $params = null, array  $options = null) : \Pop\Db\Gateway\Table

Select rows from the table

Parameters

array $columns
mixed $where
array $params
array $options

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Table

insert()

insert(array  $columns) : \Pop\Db\Gateway\Table

Insert rows into the table

Parameters

array $columns

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Table

update()

update(array  $columns, mixed  $where = null, array  $pars = null) : \Pop\Db\Gateway\Table

Update rows in the table

Parameters

array $columns
mixed $where
array $pars

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Table

delete()

delete(mixed  $where = null, array  $pars = null) : \Pop\Db\Gateway\Table

Delete rows from the table

Parameters

mixed $where
array $pars

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Table

getOrder()

getOrder(string  $order) : array

Get the order by values

Parameters

string $order

Returns

array