Stud.IP  5.4
Migration Class Reference
Inheritance diagram for Migration:
TestMigrationOne TestMigrationTen TestMigrationTwo TestMigrationTwoOne

Public Member Functions

 __construct ($verbose=false)
 
 setVerbose ($state=true)
 
 description ()
 
 getName ()
 
 migrate ($direction)
 
 announce ($format)
 

Protected Member Functions

 up ()
 
 down ()
 
 write ($text='')
 
 mark ($text, $sign='=')
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $verbose = false)

Initalize a Migration object (optionally using verbose output).

Parameters
boolean$verboseverbose output (default FALSE)

Member Function Documentation

◆ announce()

announce (   $format)

Print the given formatted string (if verbose output is enabled). Output always includes the migration's class name.

Parameters
string$format,...printf-style format string and parameters

◆ description()

description ( )

Abstract method describing this migration step. This method should be implemented in a migration subclass.

Returns
string migration description

◆ down()

down ( )
protected

Abstract method reverting this migration step. This method should be implemented in a migration subclass.

◆ getName()

getName ( )

Returns the name of the migration. If the migration is an anonymous class, the the name is created from the filename. Otherwise, it's the class name of the migration.

Returns
string

◆ mark()

mark (   $text,
  $sign = '=' 
)
protected

Pads and highlights a given text to a specific length with the given sign.

Parameters
string$text
string$sign

◆ migrate()

migrate (   $direction)

Perform or revert this migration, depending on the indicated direction.

Parameters
?string$direction migration direction (either 'up' or 'down')

◆ setVerbose()

setVerbose (   $state = true)

Sets the verbose state of this migration.

Parameters
boolean$stateVerbosity state

◆ up()

up ( )
protected

Abstract method performing this migration step. This method should be implemented in a migration subclass.

◆ write()

write (   $text = '')
protected

Print the given string (if verbose output is enabled).

Parameters
string$texttext to print

The documentation for this class was generated from the following file: