Documentation

AbstractRecord
in package
implements ArrayAccess, Countable, IteratorAggregate

AbstractYes

Abstract record class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
6.5.0

Table of Contents

Interfaces

ArrayAccess
Countable
IteratorAggregate

Properties

$isNew  : bool
Is new record flag
$isTransaction  : bool
Is transaction flag
$prefix  : string|null
Table prefix
$primaryKeys  : array<string|int, mixed>
Primary keys
$relationships  : array<string|int, mixed>
Relationships
$rowGateway  : Row|null
Row gateway
$table  : string|null
Table name
$tableGateway  : Table|null
Table gateway
$with  : array<string|int, mixed>
With relationships
$withChildren  : string|null
With relationship children
$withOptions  : array<string|int, mixed>
With relationship options

Methods

__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
commitTransaction()  : AbstractRecord
Commit transaction
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|null
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|null
Get the row gateway
getRows()  : Collection
Get the rows
getTable()  : string|null
Get the table
getTableGateway()  : Table|null
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
isTransaction()  : bool
Is transaction
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
rollbackTransaction()  : AbstractRecord
Rollback transaction
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()  : AbstractRecord
Set the table from a class name
startTransaction()  : AbstractRecord
Start transaction
toArray()  : array<string|int, mixed>
Get column values as array

Properties

$isTransaction

Is transaction flag

protected bool $isTransaction = false

$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|null $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

__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

__unset()

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

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

addWith()

Set with relationships

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

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

getRelationships()

Get relationships

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

getTable()

Get the table

public getTable() : string|null
Return values
string|null

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

isTransaction()

Is transaction

public isTransaction() : 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

offsetSet()

ArrayAccess offsetSet

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

offsetUnset()

ArrayAccess offsetUnset

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

processRow()

Process a table row

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

processRows()

Process table rows

public processRows(array<string|int, mixed> $rows[, bool $toArray = false ]) : array<string|int, mixed>
Parameters
$rows : array<string|int, mixed>
$toArray : 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>|null $rows = null ][, bool $toArray = false ]) : AbstractRecord
Parameters
$rows : array<string|int, mixed>|null = null
$toArray : bool = false
Return values
AbstractRecord

toArray()

Get column values as array

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

        
On this page

Search results