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

$dirty

$dirty : array

Row fields that have been changed

Type

array

Methods

__construct()

__construct(string  $table, mixed  $primaryKeys = null) 

Constructor

Instantiate the row gateway object.

Parameters

string $table
mixed $primaryKeys

getTable()

getTable() : string

Get the table name

Returns

string

getTableInfo()

getTableInfo(\Pop\Db\Adapter\AbstractAdapter  $db = null) : array

Get table info

Parameters

\Pop\Db\Adapter\AbstractAdapter $db

Returns

array

setPrimaryKeys()

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

Set the primary keys

Parameters

mixed $keys

Returns

\Pop\Db\Gateway\Row

getPrimaryKeys()

getPrimaryKeys() : array

Get the primary keys

Returns

array

setPrimaryValues()

setPrimaryValues(mixed  $values) : \Pop\Db\Gateway\Row

Set the primary values

Parameters

mixed $values

Returns

\Pop\Db\Gateway\Row

getPrimaryValues()

getPrimaryValues() : array

Get the primary values

Returns

array

doesPrimaryCountMatch()

doesPrimaryCountMatch() : boolean

Determine if number of primary keys and primary values match

Throws

\Pop\Db\Gateway\Exception

Returns

boolean

setColumns()

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

Set the columns

Parameters

array $columns

Returns

\Pop\Db\Gateway\Row

getColumns()

getColumns() : array

Get the columns

Returns

array

isDirty()

isDirty() : boolean

Check if row data is dirty

Returns

boolean

getDirty()

getDirty() : array

Get dirty columns

Returns

array

resetDirty()

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

Reset dirty columns

Returns

\Pop\Db\Gateway\Row

find()

find(mixed  $values, array  $selectColumns = array()) : array

Find row by primary key values

Parameters

mixed $values
array $selectColumns

Throws

\Pop\Db\Gateway\Exception

Returns

array

save()

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

Save a new row in the table

Parameters

array $columns

Returns

\Pop\Db\Gateway\Row

update()

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

Update an existing row in the table

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Row

delete()

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

Delete row from the table using the primary key(s)

Throws

\Pop\Db\Gateway\Exception

Returns

\Pop\Db\Gateway\Row

count()

count() : integer

Method to get the count of items in the row

Returns

integer

getIterator()

getIterator() : \ArrayIterator

Method to iterate over the columns

Returns

\ArrayIterator

toArray()

toArray() : array

Method to convert row gateway to an array

Returns

array

__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

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Returns

mixed

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : void

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset