Table manipulation using arrays.
Accessing the table as an array produces Column instances.
Protected Properties | |
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, array $columns) |
Public Methods | |
__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 | |
Statement | cache (string $key, Closure $prepare) |
Caches a prepared statement. More... | |
|
protected |
Prepared statement cache, keyed by function name.
|
final |
int apply | ( | array | $values | ) |
INSERT IGNORE
array | $values |
|
protected |
int count | ( | array | $match = [] | ) |
array | $match | [a => b] |
int delete | ( | array | $match | ) |
Executes a deletion using arbitrary columns.
array | $match |
Column [] getColumns | ( | ) |
Reimplemented from AbstractTable.
|
final |
Statement insert | ( | array | $values | ) |
Column offsetGet | ( | $column | ) |
Select array [] select | ( | $expressions = ['*'] | ) |
Returns a selection object for columns or expressions in the table.
string | string[] | $expressions |
Table setName | ( | string | $name | ) |
Returns an aliased clone for joins.
Columns are also re-qualified.
If you want to rename the table in the schema, use Schema::renameTable()
string | $name |
int update | ( | array | $values, |
array | $match | ||
) |
Executes an update using arbitrary columns.
array | $values | |
array | $match |