Documentation

AbstractRecord
in package
implements ArrayAccess, Countable, IteratorAggregate

Abstract record class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.3.0

Interfaces, Classes and Traits

ArrayAccess
Countable
IteratorAggregate

Table of Contents

$isNew  : bool
Is new record flag
$prefix  : string
Table prefix
$primaryKeys  : array<string|int, mixed>
Primary keys
$relationships  : array<string|int, mixed>
Relationships
$rowGateway  : Row
Row gateway
$table  : string
Table name
$tableGateway  : Table
Table gateway
$with  : array<string|int, mixed>
With relationships
$withChildren  : string
With relationship children
$withOptions  : array<string|int, mixed>
With relationship options
__get()  : mixed
Magic method to return the value of $this->rowGateway[$name]
__isset()  : bool
Magic method to return the isset value of $this->rowGateway[$name]
__set()  : void
Magic method to set the property to the value of $this->rowGateway[$name]
__unset()  : void
Magic method to unset $this->rowGateway[$name]
addWith()  : AbstractRecord
Set with relationships
count()  : int
Method to get count of fields in row gateway
countRows()  : int
Get the count of rows returned in the result
getFullTable()  : string
Get the full table name (prefix + table)
getIterator()  : ArrayIterator
Method to iterate over the columns
getPrefix()  : string
Get the table prefix
getPrimaryKeys()  : array<string|int, mixed>
Get the primary keys
getPrimaryValues()  : array<string|int, mixed>
Get the primary values
getRelationship()  : mixed
Get relationship
getRelationships()  : array<string|int, mixed>
Get relationships
getRowGateway()  : Row
Get the row gateway
getRows()  : Collection
Get the rows
getTable()  : string
Get the table
getTableGateway()  : Table
Get the table gateway
getWithRelationships()  : AbstractRecord
Get with relationships
getWiths()  : array<string|int, mixed>
Get with relationships
hasRelationship()  : bool
Has relationship
hasRelationships()  : bool
Get relationships
hasRows()  : bool
Determine if the result has rows
hasWith()  : bool
Determine if there is specific with relationship
hasWiths()  : bool
Determine if there are with relationships
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
processRow()  : mixed
Process a table row
processRows()  : array<string|int, mixed>
Process table rows
processWithRelationships()  : AbstractRecord
Process with relationships
rows()  : Collection
Get the rows (alias method)
setColumns()  : AbstractRecord
Set all the table column values at once
setPrefix()  : AbstractRecord
Set the table prefix
setPrimaryKeys()  : AbstractRecord
Set the primary keys
setRelationship()  : AbstractRecord
Set relationship
setRows()  : AbstractRecord
Set all the table rows at once
setTable()  : AbstractRecord
Set the table
setTableFromClassName()  : mixed
Set the table from a class name
toArray()  : array<string|int, mixed>
Get column values as array

Properties

$primaryKeys

Primary keys

protected array<string|int, mixed> $primaryKeys = ['id']

$relationships

Relationships

protected array<string|int, mixed> $relationships = []

$with

With relationships

protected array<string|int, mixed> $with = []

$withChildren

With relationship children

protected string $withChildren = null

$withOptions

With relationship options

protected array<string|int, mixed> $withOptions = []

Methods

__get()

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

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

__isset()

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

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

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

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Return values
void

__unset()

Magic method to unset $this->rowGateway[$name]

public __unset(string $name) : void
Parameters
$name : string
Return values
void

addWith()

Set with relationships

public addWith(string $name[, array<string|int, mixed> $options = null ]) : AbstractRecord
Parameters
$name : string
$options : array<string|int, mixed> = null
Return values
AbstractRecord

count()

Method to get count of fields in row gateway

public count() : int
Return values
int

countRows()

Get the count of rows returned in the result

public countRows() : int
Return values
int

getFullTable()

Get the full table name (prefix + table)

public getFullTable() : string
Return values
string

getIterator()

Method to iterate over the columns

public getIterator() : ArrayIterator
Return values
ArrayIterator

getPrefix()

Get the table prefix

public getPrefix() : string
Return values
string

getPrimaryKeys()

Get the primary keys

public getPrimaryKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPrimaryValues()

Get the primary values

public getPrimaryValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRelationship()

Get relationship

public getRelationship(string $name) : mixed
Parameters
$name : string
Return values
mixed

getRelationships()

Get relationships

public getRelationships() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTable()

Get the table

public getTable() : string
Return values
string

getWiths()

Get with relationships

public getWiths() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasRelationship()

Has relationship

public hasRelationship(string $name) : bool
Parameters
$name : string
Return values
bool

hasRelationships()

Get relationships

public hasRelationships() : bool
Return values
bool

hasRows()

Determine if the result has rows

public hasRows() : bool
Return values
bool

hasWith()

Determine if there is specific with relationship

public hasWith(string $name) : bool
Parameters
$name : string
Return values
bool

hasWiths()

Determine if there are with relationships

public hasWiths() : bool
Return values
bool

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

processRow()

Process a table row

public processRow(array<string|int, mixed> $row[, bool $asArray = false ]) : mixed
Parameters
$row : array<string|int, mixed>
$asArray : bool = false
Return values
mixed

processRows()

Process table rows

public processRows(array<string|int, mixed> $rows[, bool $asArray = false ]) : array<string|int, mixed>
Parameters
$rows : array<string|int, mixed>
$asArray : bool = false
Return values
array<string|int, mixed>

processWithRelationships()

Process with relationships

public processWithRelationships(array<string|int, mixed> $rows) : AbstractRecord
Parameters
$rows : array<string|int, mixed>
Return values
AbstractRecord

setRows()

Set all the table rows at once

public setRows([array<string|int, mixed> $rows = null ][, bool $asArray = false ]) : AbstractRecord
Parameters
$rows : array<string|int, mixed> = null
$asArray : bool = false
Return values
AbstractRecord

setTableFromClassName()

Set the table from a class name

public setTableFromClassName([string $class = null ]) : mixed
Parameters
$class : string = null
Return values
mixed

toArray()

Get column values as array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results