CSMigrationScript
in package
Defines an object to store information for the migration script.
It provides getter method to receive information of the migration script.
Tags
Table of Contents
- __construct() : mixed
- Defines the constructor of the migration script.
- getExecutionType() : int
- Returns the execution type of the migration script.
- getName() : string
- Returns the name of the migration script.
- getRecordClassIds() : array<string|int, int>
- Returns the list of the target record class ids.
- getRecordClassNames() : array<string|int, string>
- Returns the list of the target record class names.
- getRecords() : array<string|int, Record>
- Returns the list of the target records.
- getRecordUniqueKeys() : array<string|int, string>
- Returns the formatted unique keys for the script executions.
- getUniqueKey() : string
- Returns the formatted unique key for the migration script.
- hasBeenExecuted() : bool
- Checks whether the migration script has already been executed.
- hasExecutionType() : bool
- Checks whether the migration script has the given execution type.
- hasName() : bool
- Checks whether the migration script has the given name.
Methods
__construct()
Defines the constructor of the migration script.
public
__construct(string $sMigrationName, array<string|int, mixed> $aTargetRecordNames[, int $iExecutionType = CSMigration::EXECUTION_TYPE_AFTER_UPDATE_DATA_MODEL ]) : mixed
Parameters
- $sMigrationName : string
-
The name of the migration script.
- $aTargetRecordNames : array<string|int, mixed>
-
The array of target record class names.
- $iExecutionType : int = CSMigration::EXECUTION_TYPE_AFTER_UPDATE_DATA_MODEL
-
The target execution type of the migration script.
Tags
Return values
mixed —getExecutionType()
Returns the execution type of the migration script.
public
getExecutionType() : int
Please see the possible constants CSMigration::EXECUTION_TYPE_*
Tags
Return values
int —getName()
Returns the name of the migration script.
public
getName() : string
Tags
Return values
string —getRecordClassIds()
Returns the list of the target record class ids.
public
getRecordClassIds() : array<string|int, int>
Tags
Return values
array<string|int, int> —getRecordClassNames()
Returns the list of the target record class names.
public
getRecordClassNames() : array<string|int, string>
Tags
Return values
array<string|int, string> —getRecords()
Returns the list of the target records.
public
getRecords() : array<string|int, Record>
Tags
Return values
array<string|int, Record> —getRecordUniqueKeys()
Returns the formatted unique keys for the script executions.
public
getRecordUniqueKeys() : array<string|int, string>
The number of unique keys are based on the number of target record class names.
Tags
Return values
array<string|int, string> —getUniqueKey()
Returns the formatted unique key for the migration script.
public
getUniqueKey() : string
Tags
Return values
string —hasBeenExecuted()
Checks whether the migration script has already been executed.
public
hasBeenExecuted() : bool
Tags
Return values
bool —hasExecutionType()
Checks whether the migration script has the given execution type.
public
hasExecutionType(int $iExecutionType) : bool
Parameters
- $iExecutionType : int
-
The execution type to compare it with the migration script execution type.
Tags
Return values
bool —hasName()
Checks whether the migration script has the given name.
public
hasName(string $sName) : bool
Parameters
- $sName : string
-
The name to compare it with the migration script name.
