Piwik\Columns\

Updater

Class that handles dimension updates

Methods

The class defines the following methods:

getMigrations()

Return migrations to be executed in this update.

Migrations should be defined here, instead of in doUpdate(), since this method is used to display a preview of which migrations and database queries an update will run. If you execute migrations directly in doUpdate(), they won't be displayed to the user.

Signature

  • It accepts the following parameter(s):

  • It returns a Migration[] value.

doUpdate()

Perform the incremental version update.

This method should preform all updating logic. If you define migrations in an overridden getMigrations() method, you must call Updater::executeMigrations() here.

See \Piwik\Plugins\ExamplePlugin\Updates\Updates_0_0_2 for an example.

Signature

  • It accepts the following parameter(s):

  • It does not return anything.