class CRM_Upgrade_Incremental_php_FiveTwenty extends CRM_Upgrade_Incremental_Base

Upgrade logic for FiveTwenty

Constants

BATCH_SIZE

Properties

static protected $relationshipTypes

Methods

bool
verifyPreDBstate($errors)

Verify DB state.

setPreUpgradeMessage($preUpgradeMessage, string $rev, null $currentVer = NULL)

Compute any messages which should be displayed beforeupgrade.

setPostUpgradeMessage(string $postUpgradeMessage, string $rev)

Compute any messages which should be displayed after upgrade.

static bool
runSql(CRM_Queue_TaskContext $ctx, string $rev)

(Queue Task Callback)

addTask(string $title, string $funcName)

Syntactic sugar for adding a task.

static bool
removePaymentProcessorType(CRM_Queue_TaskContext $ctx, string $name)

Remove a payment processor if not in use

static bool
checkFKExists(string $table_name, string $constraint_name)

No description

static bool
addColumn(CRM_Queue_TaskContext $ctx, string $table, string $column, string $properties, bool $localizable = FALSE, string|null $version = NULL)

Add a column to a table if it doesn't already exist

static 
updateMessageTemplates(CRM_Queue_TaskContext $ctx, string $version)

Do any relevant message template updates.

static bool
updateContributeSettings($ctx)

Re-save any valid values from contribute settings into the normal setting format.

bool
updateSmartGroups(CRM_Queue_TaskContext $ctx, array $actions)

Do any relevant smart group updates.

static bool
dropColumn(CRM_Queue_TaskContext $ctx, string $table, string $column)

Drop a column from a table if it exist.

static bool
addIndex(CRM_Queue_TaskContext $ctx, string $table, string|array $column)

Add a index to a table column.

static bool
dropIndex(CRM_Queue_TaskContext $ctx, string $table, string $indexName)

Drop a index from a table if it exist.

static bool
dropTableIfEmpty(CRM_Queue_TaskContext $ctx, string $table)

Drop a table.

static bool
rebuildMultilingalSchema(CRM_Queue_TaskContext $ctx, string|null $version = NULL)

Rebuild Multilingual Schema.

upgrade_5_20_alpha1(string $rev)

Upgrade function.

static 
templateStatus(CRM_Queue_TaskContext $ctx)

No description

static bool
changeCaseTypeAutoassignee()

Change direction of activity autoassignees in case type xml for bidirectional relationship types if they point the other way. This is mostly a visual issue on the case type edit screen and doesn't affect normal operation, but could lead to confusion and a future mixup.

static 
processCaseTypeAutoassignee($caseTypeId, $definition)

Process a single case type

static bool
changeCaseTypeLabelToName()

Change labels in case type xml definition back to names. (dev/core#1046) ONLY for ones using database storage - don't want to "fork" case types that aren't currently forked.

static array
_changeCaseTypeLabelToName($isDryRun = FALSE)

Change labels in case type xml definition back to names. (dev/core#1046) ONLY for ones using database storage - don't want to "fork" case types that aren't currently forked.

Details

bool verifyPreDBstate($errors)

Verify DB state.

Parameters

$errors

Return Value

bool

at line 48
setPreUpgradeMessage($preUpgradeMessage, string $rev, null $currentVer = NULL)

Compute any messages which should be displayed beforeupgrade.

Note: This function is called iteratively for each upcoming revision to the database.

Parameters

$preUpgradeMessage
string $rev a version number, e.g. '4.8.alpha1', '4.8.beta3', '4.8.0'.
null $currentVer

at line 75
setPostUpgradeMessage(string $postUpgradeMessage, string $rev)

Compute any messages which should be displayed after upgrade.

Parameters

string $postUpgradeMessage alterable.
string $rev an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.

static bool runSql(CRM_Queue_TaskContext $ctx, string $rev)

(Queue Task Callback)

Parameters

CRM_Queue_TaskContext $ctx
string $rev

Return Value

bool

protected addTask(string $title, string $funcName)

Syntactic sugar for adding a task.

Task is (a) in this class and (b) has a high priority.

After passing the $funcName, you can also pass parameters that will go to the function. Note that all params must be serializable.

Parameters

string $title
string $funcName

static bool removePaymentProcessorType(CRM_Queue_TaskContext $ctx, string $name)

Remove a payment processor if not in use

Parameters

CRM_Queue_TaskContext $ctx
string $name

Return Value

bool

Exceptions

CiviCRM_API3_Exception

static bool checkFKExists(string $table_name, string $constraint_name)

Parameters

string $table_name
string $constraint_name

Return Value

bool

static bool addColumn(CRM_Queue_TaskContext $ctx, string $table, string $column, string $properties, bool $localizable = FALSE, string|null $version = NULL)

Add a column to a table if it doesn't already exist

Parameters

CRM_Queue_TaskContext $ctx
string $table
string $column
string $properties
bool $localizable is this a field that should be localized
string|null $version CiviCRM version to use if rebuilding multilingual schema

Return Value

bool

static updateMessageTemplates(CRM_Queue_TaskContext $ctx, string $version)

Do any relevant message template updates.

Parameters

CRM_Queue_TaskContext $ctx
string $version

static bool updateContributeSettings($ctx)

Re-save any valid values from contribute settings into the normal setting format.

We render the array of contribution_invoice_settings and any that have metadata defined we add to the correct key. This is safe to run even if no settings are to be converted, per the test in testConvertUpgradeContributeSettings.

Parameters

$ctx

Return Value

bool

bool updateSmartGroups(CRM_Queue_TaskContext $ctx, array $actions)

Do any relevant smart group updates.

Parameters

CRM_Queue_TaskContext $ctx
array $actions

Return Value

bool

static bool dropColumn(CRM_Queue_TaskContext $ctx, string $table, string $column)

Drop a column from a table if it exist.

Parameters

CRM_Queue_TaskContext $ctx
string $table
string $column

Return Value

bool

static bool addIndex(CRM_Queue_TaskContext $ctx, string $table, string|array $column)

Add a index to a table column.

Parameters

CRM_Queue_TaskContext $ctx
string $table
string|array $column

Return Value

bool

static bool dropIndex(CRM_Queue_TaskContext $ctx, string $table, string $indexName)

Drop a index from a table if it exist.

Parameters

CRM_Queue_TaskContext $ctx
string $table
string $indexName

Return Value

bool

static bool dropTableIfEmpty(CRM_Queue_TaskContext $ctx, string $table)

Drop a table.

.. but only if it's empty.

Parameters

CRM_Queue_TaskContext $ctx
string $table

Return Value

bool

static bool rebuildMultilingalSchema(CRM_Queue_TaskContext $ctx, string|null $version = NULL)

Rebuild Multilingual Schema.

Parameters

CRM_Queue_TaskContext $ctx
string|null $version CiviCRM version to use if rebuilding multilingual schema

Return Value

bool

at line 97
upgrade_5_20_alpha1(string $rev)

Upgrade function.

Parameters

string $rev

at line 156
static templateStatus(CRM_Queue_TaskContext $ctx)

Parameters

CRM_Queue_TaskContext $ctx

at line 186
static bool changeCaseTypeAutoassignee()

Change direction of activity autoassignees in case type xml for bidirectional relationship types if they point the other way. This is mostly a visual issue on the case type edit screen and doesn't affect normal operation, but could lead to confusion and a future mixup.

(dev/core#1046) ONLY for ones using database storage - don't want to "fork" case types that aren't currently forked.

Earlier iterations of this used the api and array manipulation and then another iteration used SimpleXML manipulation, but both suffered from weirdnesses in how conversion back and forth worked.

Here we use SQL and a regex. The thing we're changing is pretty well-defined and unique: N_b_a

Return Value

bool

at line 206
static processCaseTypeAutoassignee($caseTypeId, $definition)

Process a single case type

Parameters

$caseTypeId int
$definition string xml string

at line 264
static bool changeCaseTypeLabelToName()

Change labels in case type xml definition back to names. (dev/core#1046) ONLY for ones using database storage - don't want to "fork" case types that aren't currently forked.

Return Value

bool

at line 279
static array _changeCaseTypeLabelToName($isDryRun = FALSE)

Change labels in case type xml definition back to names. (dev/core#1046) ONLY for ones using database storage - don't want to "fork" case types that aren't currently forked.

Parameters

$isDryRun bool If TRUE then don't actually change anything just report warnings.

Return Value

array List of warning messages.