Array storage in an extension table.
Protected Properties | |
string | $type |
The scalar storage type for the value column (implied NOT NULL ). More... | |
Protected Properties inherited from Table | |
Statement[] | $_cache = [] |
Prepared statement cache, keyed by function name. More... | |
Column[] | $columns = [] |
[name => Column] More... | |
string | $name |
Protected Properties inherited from AbstractTable | |
DB | $db |
Public Static Methods | |
magic static self | factory (DB $db, string $name, string $type='string') |
Public Static Methods inherited from Table | |
magic static self | factory (DB $db, string $name, array $columns) |
Public Methods | |
__construct (DB $db, string $name, string $type='string') | |
bool | exists (int $id, string $attribute) |
Whether an entity has an attribute. More... | |
Select | findAll (array $match) |
Self-joins to return a Select for the entity column, matching on attribute and value. More... | |
string | getType () |
scalar[] | load (int $id) |
Returns an entity's attributes. More... | |
scalar[][] | loadAll (array $ids) |
Returns associative attribute-value arrays for the given IDs. More... | |
$this | save (int $id, array $values) |
Upserts an entity's attributes with those given. More... | |
Public Methods inherited from Table | |
__construct (DB $db, string $name, array $columns) | |
string | __toString () |
Returns the table name. More... | |
int | apply (array $values) |
INSERT IGNORE More... | |
int | count (array $match=[]) |
int | delete (array $match) |
Executes a deletion using arbitrary columns. More... | |
Column[] | getColumns () |
string | getName () |
Statement | insert (array $values) |
Executes an insertion using arbitrary columns. More... | |
Column | offsetGet ($column) |
Select array[] | select ($expressions=[' *']) |
Returns a selection object for columns or expressions in the table. More... | |
Table | setName (string $name) |
Returns an aliased clone for joins. More... | |
int | update (array $values, array $match) |
Executes an update using arbitrary columns. More... | |
Public Methods inherited from AbstractTable | |
__construct (DB $db) | |
bool | offsetExists ($column) |
void | offsetSet ($offset, $value) |
Throws. More... | |
void | offsetUnset ($name) |
Throws. More... | |
Protected Methods | |
scalar | setType ($value) |
Protected Methods inherited from Table | |
Statement | cache (string $key, Closure $prepare) |
Caches a prepared statement. More... | |
|
protected |
The scalar storage type for the value
column (implied NOT NULL
).
__construct | ( | DB | $db, |
string | $name, | ||
string | $type = 'string' |
||
) |
DB | $db | |
string | $name | |
string | $type |
bool exists | ( | int | $id, |
string | $attribute | ||
) |
Whether an entity has an attribute.
int | $id | |
string | $attribute |
Select findAll | ( | array | $match | ) |
Self-joins to return a Select for the entity
column, matching on attribute and value.
array | $match | [attribute => value] . If empty, selects all IDs for entities having at least one attribute. |
|
final |
scalar [] load | ( | int | $id | ) |
Returns an entity's attributes.
int | $id |
[attribute => value]
scalar [][] loadAll | ( | array | $ids | ) |
Returns associative attribute-value arrays for the given IDs.
int[] | $ids |
[id => attribute => value]
$this save | ( | int | $id, |
array | $values | ||
) |
Upserts an entity's attributes with those given.
Stored attributes not given here are pruned.
NULL
attributes are also pruned.
int | $id | |
array | $values | [attribute => value] |
|
protected |
scalar | $value |