Class humhub\components\Migration

Inheritancehumhub\components\Migration » yii\db\Migration

Migration is the base class for representing a database migration.

See also \yii\db\Migration.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
insertSilent() Creates and executes an INSERT SQL statement without any output The method will properly escape the column names, and bind the values to be inserted. humhub\components\Migration
updateSilent() Creates and executes an UPDATE SQL statement without any output. humhub\components\Migration

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
renameClass() Renames a class humhub\components\Migration

Method Details

insertSilent() public method

Creates and executes an INSERT SQL statement without any output The method will properly escape the column names, and bind the values to be inserted.

public void insertSilent ( $table, $columns )
$table string

The table that new rows will be inserted into.

$columns array

The column data (name => value) to be inserted into the table.

renameClass() protected method

Renames a class

This is often required because some classes are also stored in database e.g. for polymorphic relations.

This method is also required for 0.20 namespace migration!

protected void renameClass ( $oldClass, $newClass )
$oldClass string
$newClass string
updateSilent() public method

Creates and executes an UPDATE SQL statement without any output.

The method will properly escape the column names and bind the values to be updated.

public void updateSilent ( $table, $columns, $condition '', $params = [] )
$table string

The table to be updated.

$columns array

The column data (name => value) to be updated.

$condition array|string

The conditions that will be put in the WHERE part. Please refer to \humhub\components\Query::where() on how to specify conditions.

$params array

The parameters to be bound to the query.