\Pop\Db\GatewayRow

Row gateway class

Summary

Methods
Properties
Constants
__construct()
setTable()
setPrimaryKeys()
getSql()
sql()
getTable()
getPrimaryKeys()
getTableInfo()
getColumns()
setColumns()
find()
save()
delete()
__set()
__get()
__isset()
__unset()
No public properties found
No constants found
getOrder()
$table
$primaryKeys
$sql
$primaryValues
$columns
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

$primaryValues

$primaryValues : array

Primary values

Type

array

$columns

$columns : array

Row column values

Type

array

Methods

__construct()

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

Constructor

Instantiate the Gateway\Row object.

Parameters

\Pop\Db\Sql $sql
mixed $keys
string $table

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Row

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

getColumns()

getColumns() : array

Get the columns

Returns

array

setColumns()

setColumns(array  $columns = array()) : \Pop\Db\Gateway\Row

Set the columns

Parameters

array $columns

Returns

\Pop\Db\Gateway\Row

find()

find(mixed  $values) : void

Find row by primary key values

Parameters

mixed $values

Throws

\Pop\Db\Gateway\Exception

save()

save(boolean  $new = false) : \Pop\Db\Gateway\Row

Save (insert new or update existing) row in the table

Parameters

boolean $new

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Row

delete()

delete() : \Pop\Db\Gateway\Row

Delete row from the table

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Row

__set()

__set(string  $name, mixed  $value) : void

Magic method to set the property to the value of $this->columns[$name].

Parameters

string $name
mixed $value

__get()

__get(string  $name) : mixed

Magic method to return the value of $this->columns[$name].

Parameters

string $name

Returns

mixed

__isset()

__isset(string  $name) : boolean

Magic method to return the isset value of $this->columns[$name].

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Magic method to unset $this->columns[$name].

Parameters

string $name

getOrder()

getOrder(string  $order) : array

Get the order by values

Parameters

string $order

Returns

array