Method |
Description |
|
__construct ( $name, $connection ) |
Constructor |
|
__toString ( ) |
Return the string name of the table |
|
columns ( ) : array |
Returns all the database columns in SHOW COLUMN format |
|
create ( $columns, $options = 'charset=utf8 engine=innodb' ) |
Creates the table, fails if the table exists |
|
createIfNotExists ( $columns, $options = 'charset=utf8 engine=innodb' ) |
Creates the table if it doesn't exist |
|
delete ( $criteria = NULL ) |
Deletes rows in the table |
|
drop ( ) |
Drops the table |
|
dropIfExists ( ) |
Drops the table if it exists |
|
exists ( ) |
Determines if the table exists (name only, column definition not checked) |
|
insert ( $data ) |
Inserts a row into the table |
|
name ( ) |
Returns the name of the table as a TableName |
|
query ( $criteria = null ) |
Builds a Query object for the table |
|
replace ( $data ) |
Inserts a row, or replaces it entirely if a row with the primary key exists |
|
truncate ( ) |
Truncates the table |
|
update ( $data, Criteria $where, $limit = false ) |
Updates a row into the table |
|
upsert ( $data ) |
Tries to update a record, or inserts if it doesn't exist. Worth noting
that affectedRows will be 2 on an update, 1 on an insert. |
|
where ( $where, $params = [] ) |
Builds a TableCriteria object for the table |
|