ActiveRow
class ActiveRow implements IteratorAggregate, ArrayAccess
Represents database row with support for relations.
ActiveRow is based on the great library NotORM http://www.notorm.com written by Jakub Vrana.
Methods
No description
No description
No description
Returns primary key value, or an array of values for composite primary keys.
Returns row signature (composition of primary keys).
Returns referenced row, or null if the row does not exist.
Returns referencing rows collection.
Updates row data and refreshes the instance from database. Returns true if the row was changed.
Deletes the row from database.
No description
No description
No description
No description
No description
No description
Returns column value, or a referenced row if the key matches a relationship.
No description
No description
No description
No description
Details
at line 24
__construct(array $data, Selection $table)
No description
at line 37
void
setTable(Selection $table)
| internal |
No description
at line 47
Selection
getTable()
| internal |
No description
at line 53
Explorer
getExplorer()
No description
at line 59
string
__toString()
No description
at line 66
array
toArray()
No description
at line 76
mixed
getPrimary(bool $throw = true)
Returns primary key value, or an array of values for composite primary keys.
at line 112
string
getSignature(bool $throw = true)
Returns row signature (composition of primary keys).
at line 121
ActiveRow|null
ref(string $key, string|null $throughColumn = null)
Returns referenced row, or null if the row does not exist.
at line 136
GroupedSelection
related(string $key, string|null $throughColumn = null)
Returns referencing rows collection.
at line 151
bool
update(iterable $data)
Updates row data and refreshes the instance from database. Returns true if the row was changed.
at line 186
int
delete()
Deletes the row from database.
at line 204
Iterator
getIterator()
No description
at line 214
void
offsetSet($column, $value)
No description
at line 220
mixed
offsetGet($column)
No description
at line 226
bool
offsetExists($column)
No description
at line 232
void
offsetUnset($column)
No description
at line 238
void
__set(string $column, mixed $value)
No description
at line 249
mixed
__get(string $key)
Returns column value, or a referenced row if the key matches a relationship.
at line 267
bool
__isset(string $key)
No description
at line 284
void
__unset(string $key)
No description
at line 291
bool
accessColumn(string|null $key, bool $selectColumn = true)
| internal |
No description
at line 307
protected void
removeAccessColumn(string $key)
No description