Row
extends AbstractGateway
in package
implements
ArrayAccess, Countable, IteratorAggregate
Row gateway class
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $columns : array<string|int, mixed>
- Row column values
- $dirty : array<string|int, mixed>
- Row fields that have been changed
- $primaryKeys : array<string|int, mixed>
- Primary keys
- $primaryValues : array<string|int, mixed>
- Primary values
- $table : string|null
- Table
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Magic method to return the value of $this->columns[$name].
- __isset() : bool
- Magic method to return the isset value of $this->columns[$name].
- __set() : void
- Magic method to set the property to the value of $this->columns[$name].
- __unset() : void
- Magic method to unset $this->columns[$name].
- count() : int
- Method to get the count of items in the row
- delete() : Row
- Delete row from the table using the primary key(s)
- doesPrimaryCountMatch() : bool
- Determine if number of primary keys and primary values match
- find() : array<string|int, mixed>
- Find row by primary key values
- getColumns() : array<string|int, mixed>
- Get the columns
- getDirty() : array<string|int, mixed>
- Get dirty columns
- getIterator() : ArrayIterator
- Method to iterate over the columns
- getPrimaryKeys() : array<string|int, mixed>
- Get the primary keys
- getPrimaryValues() : array<string|int, mixed>
- Get the primary values
- getTable() : string
- Get the table name
- getTableInfo() : array<string|int, mixed>
- Get table info
- isDirty() : bool
- Check if row data is dirty
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- resetDirty() : Row
- Reset dirty columns
- save() : Row
- Save a new row in the table
- setColumns() : Row
- Set the columns
- setPrimaryKeys() : Row
- Set the primary keys
- setPrimaryValues() : Row
- Set the primary values
- toArray() : array<string|int, mixed>
- Method to convert row gateway to an array
- update() : Row
- Update an existing row in the table
Properties
$columns
Row column values
protected
array<string|int, mixed>
$columns
= []
$dirty
Row fields that have been changed
protected
array<string|int, mixed>
$dirty
= ['old' => [], 'new' => []]
$primaryKeys
Primary keys
protected
array<string|int, mixed>
$primaryKeys
= []
$primaryValues
Primary values
protected
array<string|int, mixed>
$primaryValues
= []
$table
Table
protected
string|null
$table
= null
Methods
__construct()
Constructor
public
__construct(string $table[, mixed $primaryKeys = null ]) : mixed
Instantiate the row gateway object.
Parameters
- $table : string
- $primaryKeys : mixed = null
__get()
Magic method to return the value of $this->columns[$name].
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
Magic method to return the isset value of $this->columns[$name].
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
Magic method to set the property to the value of $this->columns[$name].
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__unset()
Magic method to unset $this->columns[$name].
public
__unset(string $name) : void
Parameters
- $name : string
count()
Method to get the count of items in the row
public
count() : int
Return values
intdelete()
Delete row from the table using the primary key(s)
public
delete() : Row
Tags
Return values
RowdoesPrimaryCountMatch()
Determine if number of primary keys and primary values match
public
doesPrimaryCountMatch() : bool
Tags
Return values
boolfind()
Find row by primary key values
public
find(mixed $values[, array<string|int, mixed> $selectColumns = [] ][, array<string|int, mixed>|null $options = null ]) : array<string|int, mixed>
Parameters
- $values : mixed
- $selectColumns : array<string|int, mixed> = []
- $options : array<string|int, mixed>|null = null
Tags
Return values
array<string|int, mixed>getColumns()
Get the columns
public
getColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>getDirty()
Get dirty columns
public
getDirty() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
Method to iterate over the columns
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetPrimaryKeys()
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>getTable()
Get the table name
public
getTable() : string
Return values
stringgetTableInfo()
Get table info
public
getTableInfo([AbstractAdapter|null $db = null ]) : array<string|int, mixed>
Parameters
- $db : AbstractAdapter|null = null
Return values
array<string|int, mixed>isDirty()
Check if row data is dirty
public
isDirty() : 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
resetDirty()
Reset dirty columns
public
resetDirty() : Row
Return values
Rowsave()
Save a new row in the table
public
save([array<string|int, mixed> $columns = [] ]) : Row
Parameters
- $columns : array<string|int, mixed> = []
Return values
RowsetColumns()
Set the columns
public
setColumns([array<string|int, mixed> $columns = [] ]) : Row
Parameters
- $columns : array<string|int, mixed> = []
Return values
RowsetPrimaryKeys()
Set the primary keys
public
setPrimaryKeys(mixed $keys) : Row
Parameters
- $keys : mixed
Return values
RowsetPrimaryValues()
Set the primary values
public
setPrimaryValues(mixed $values) : Row
Parameters
- $values : mixed
Return values
RowtoArray()
Method to convert row gateway to an array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>update()
Update an existing row in the table
public
update() : Row