From its parent, a table inherits its primary key, schema options, and implements.
Parameters
$parent
public
install( void )
Creates table.
Creates table.
Throws
Exception if install fails.
public
uninstall( void )
Drops table.
Drops table.
Throws
Exception if uninstall fails.
public
is_installed( void )
: boolean
Checks whether the table is installed.
Checks whether the table is installed.
Returns
boolean true if the table exists, false otherwise.
public
resolve_statement( string$statement )
: string
Resolves statement placeholders.
Resolves statement placeholders.
The following placeholder are replaced:
{alias}: The alias of the table.
{prefix}: The prefix used for the tables of the connection.
{primary}: The primary key of the table.
{self}: The name of the table.
{self_and_related}: The escaped name of the table and the possible JOIN clauses.
Note: If the table has a multi-column primary keys {primary} is replaced by
__multicolumn_primary__<concatened_columns> where <concatened_columns> is a the columns
concatenated with an underscore ("_") as separator. For instance, if a table primary key is
made of columns "p1" and "p2", {primary} is replaced by __multicolumn_primary__p1_p2.
It's not very helpful, but we still have to decide what to do with this.
public
insert( array$values, array$options = [] )
: mixed
Inserts values into the table.
Inserts values into the table.
Parameters
$values
The values to insert.
$options
The following options can be used:
- ignore: Ignore duplicate errors.
- on duplicate: specifies the column to update on duplicate, and the values to update
them. If true the $values array is used, after the primary keys has been removed.
Returns
mixed
public
update( array$values, mixed$key )
: boolean
Update the values of an entry.
Update the values of an entry.
Even if the entry is spread over multiple tables, all the tables are updated in a single
step.