Constants

AS_ARRAY

AS_ARRAY

Constants to set individual row data type

AS_OBJECT

AS_OBJECT

AS_RECORD

AS_RECORD

Properties

$table

$table : string

Table name

Type

string

$prefix

$prefix : string

Table prefix

Type

string

$primaryKeys

$primaryKeys : array

Primary keys

Type

array

$isNew

$isNew : boolean

Is new record flag

Type

boolean

$oneToOne

$oneToOne : array

1:1 associations

Type

array

$hasOne

$hasOne : array

1:1 association objects

Type

array

$oneToMany

$oneToMany : array

1:Many associations

Type

array

$hasMany

$hasMany : array

1:many association objects

Type

array

$belongsTo

$belongsTo : array

1:1 belongs to associations

Type

array

$doesBelong

$doesBelong : array

1:1 belongs to association object

Type

array

$relationships

$relationships : array

Eager relationships

Type

array

$with

$with : string

Eager with

Type

string

$withOptions

$withOptions : array

Eager with options

Type

array

Methods

setTable()

setTable(string  $table) : \Pop\Db\Record\AbstractRecord

Set the table

Parameters

string $table

Returns

\Pop\Db\Record\AbstractRecord

setTableFromClassName()

setTableFromClassName(string  $class) : mixed

Set the table from a class name

Parameters

string $class

Returns

mixed

setPrefix()

setPrefix(string  $prefix) : \Pop\Db\Record\AbstractRecord

Set the table prefix

Parameters

string $prefix

Returns

\Pop\Db\Record\AbstractRecord

setPrimaryKeys()

setPrimaryKeys(array  $keys) : \Pop\Db\Record\AbstractRecord

Set the primary keys

Parameters

array $keys

Returns

\Pop\Db\Record\AbstractRecord

hasRelationships()

hasRelationships(integer  $id) : boolean

Has eager relationships

Parameters

integer $id

Returns

boolean

getRelationships()

getRelationships(integer  $id) : array

Get eager relationships

Parameters

integer $id

Returns

array

setWithOptions()

setWithOptions(array  $options = null) : \Pop\Db\Record\AbstractRecord

Set eager with options

Parameters

array $options

Returns

\Pop\Db\Record\AbstractRecord

getWith()

getWith(string  $name, array  $options = null) : mixed

With a 1:many relationship (eager-loading)

Parameters

string $name
array $options

Returns

mixed

getTable()

getTable() : string

Get the table

Returns

string

getFullTable()

getFullTable() : string

Get the full table name (prefix + table)

Returns

string

getPrefix()

getPrefix() : string

Get the table prefix

Returns

string

getPrimaryKeys()

getPrimaryKeys() : array

Get the primary keys

Returns

array

getRowGateway()

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

Get the row gateway

Returns

\Pop\Db\Gateway\Row

getTableGateway()

getTableGateway() : \Pop\Db\Gateway\Table

Get the table gateway

Returns

\Pop\Db\Gateway\Table

toArray()

toArray() : array

Get column values as array

Returns

array

toArrayObject()

toArrayObject() : \ArrayObject

Get column values as array object

Returns

\ArrayObject

count()

count() : integer

Get the count of rows returned in the result

Returns

integer

hasRows()

hasRows() : boolean

Determine if the result has rows

Returns

boolean

setColumns()

setColumns(mixed  $columns = null) : \Pop\Db\Record\AbstractRecord

Set all the table column values at once

Parameters

mixed $columns

Throws

\Pop\Db\Record\Exception

Returns

\Pop\Db\Record\AbstractRecord

setRows()

setRows(array  $rows = null, string  $resultAs = \Pop\Db\Record\AbstractRecord::AS_RECORD) : \Pop\Db\Record\AbstractRecord

Set all the table rows at once

Parameters

array $rows
string $resultAs

Returns

\Pop\Db\Record\AbstractRecord

processRows()

processRows(array  $rows, string  $resultAs = \Pop\Db\Record\AbstractRecord::AS_RECORD) : array

Process table rows

Parameters

array $rows
string $resultAs

Returns

array

processRow()

processRow(array  $row, string  $resultAs = \Pop\Db\Record\AbstractRecord::AS_RECORD) : mixed

Process a table row

Parameters

array $row
string $resultAs

Returns

mixed

__set()

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

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

Parameters

string $name
mixed $value

__get()

__get(string  $name) : mixed

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

Parameters

string $name

Returns

mixed

__isset()

__isset(string  $name) : boolean

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

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Magic method to unset $this->rowGateway[$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