AbstractRecord
in package
implements
ArrayAccess, Countable, IteratorAggregate
Abstract record class
Tags
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
$isNew
Is new record flag
protected
bool
$isNew
= false
$isTransaction
Is transaction flag
protected
bool
$isTransaction
= false
$prefix
Table prefix
protected
string|null
$prefix
= null
$primaryKeys
Primary keys
protected
array<string|int, mixed>
$primaryKeys
= ['id']
$relationships
Relationships
protected
array<string|int, mixed>
$relationships
= []
$rowGateway
Row gateway
protected
Row|null
$rowGateway
= null
$table
Table name
protected
string|null
$table
= null
$tableGateway
Table gateway
protected
Table|null
$tableGateway
= null
$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
AbstractRecordcommitTransaction()
Commit transaction
public
commitTransaction() : AbstractRecord
Tags
Return values
AbstractRecordcount()
Method to get count of fields in row gateway
public
count() : int
Return values
intcountRows()
Get the count of rows returned in the result
public
countRows() : int
Return values
intgetFullTable()
Get the full table name (prefix + table)
public
getFullTable() : string
Return values
stringgetIterator()
Method to iterate over the columns
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetPrefix()
Get the table prefix
public
getPrefix() : string|null
Return values
string|nullgetPrimaryKeys()
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>getRowGateway()
Get the row gateway
public
getRowGateway() : Row|null
Return values
Row|nullgetRows()
Get the rows
public
getRows() : Collection
Return values
CollectiongetTable()
Get the table
public
getTable() : string|null
Return values
string|nullgetTableGateway()
Get the table gateway
public
getTableGateway() : Table|null
Return values
Table|nullgetWithRelationships()
Get with relationships
public
getWithRelationships([bool $eager = true ]) : AbstractRecord
Parameters
- $eager : bool = true
Return values
AbstractRecordgetWiths()
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
boolhasRelationships()
Get relationships
public
hasRelationships() : bool
Return values
boolhasRows()
Determine if the result has rows
public
hasRows() : bool
Return values
boolhasWith()
Determine if there is specific with relationship
public
hasWith(string $name) : bool
Parameters
- $name : string
Return values
boolhasWiths()
Determine if there are with relationships
public
hasWiths() : bool
Return values
boolisTransaction()
Is transaction
public
isTransaction() : bool
Return values
booloffsetExists()
ArrayAccess offsetExists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
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
AbstractRecordrollbackTransaction()
Rollback transaction
public
rollbackTransaction() : AbstractRecord
Tags
Return values
AbstractRecordrows()
Get the rows (alias method)
public
rows() : Collection
Return values
CollectionsetColumns()
Set all the table column values at once
public
setColumns([mixed $columns = null ]) : AbstractRecord
Parameters
- $columns : mixed = null
Tags
Return values
AbstractRecordsetPrefix()
Set the table prefix
public
setPrefix(string $prefix) : AbstractRecord
Parameters
- $prefix : string
Return values
AbstractRecordsetPrimaryKeys()
Set the primary keys
public
setPrimaryKeys(array<string|int, mixed> $keys) : AbstractRecord
Parameters
- $keys : array<string|int, mixed>
Return values
AbstractRecordsetRelationship()
Set relationship
public
setRelationship(string $name, mixed $relationship) : AbstractRecord
Parameters
- $name : string
- $relationship : mixed
Return values
AbstractRecordsetRows()
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
AbstractRecordsetTable()
Set the table
public
setTable(string $table) : AbstractRecord
Parameters
- $table : string
Return values
AbstractRecordsetTableFromClassName()
Set the table from a class name
public
setTableFromClassName([string|null $class = null ]) : AbstractRecord
Parameters
- $class : string|null = null
Return values
AbstractRecordstartTransaction()
Start transaction
public
startTransaction() : AbstractRecord
Return values
AbstractRecordtoArray()
Get column values as array
public
toArray() : array<string|int, mixed>