KMP PHP API Reference

MigrateAwardEventsCommand extends Command
in package

Migrate Award Events Command

Migrates legacy Award Events to the new Gatherings system with the following steps:

  1. Create a "Kingdom Court" gathering activity
  2. Associate all awards with the "Kingdom Court" activity
  3. Create a "Kingdom Calendar Event" gathering type
  4. Create gatherings for each award event
  5. Add "Kingdom Court" activity to each new gathering
  6. Update award recommendations to reference gatherings instead of events

Usage: bin/cake migrate_award_events bin/cake migrate_award_events --dry-run

Table of Contents

Properties

$dryRun  : bool
$io  : ConsoleIo

Methods

execute()  : int|null
Execute the command
associateAwardsWithActivity()  : void
Step 2: Associate all awards with Kingdom Court activity
buildOptionParser()  : ConsoleOptionParser
Hook method for defining this command's option parser.
createGatheringsFromAwardEvents()  : array<string|int, mixed>
Steps 4-5: Create gatherings from award events and add Kingdom Court activity
createKingdomCalendarEventType()  : GatheringType|null
Step 3: Create Kingdom Calendar Event gathering type
createKingdomCourtActivity()  : GatheringActivity|null
Step 1: Create Kingdom Court gathering activity
updateAwardRecommendations()  : void
Steps 6-7: Update award recommendations to reference gatherings

Properties

Methods

execute()

Execute the command

public execute(Arguments $args, ConsoleIo $io) : int|null
Parameters
$args : Arguments

The command arguments.

$io : ConsoleIo

The console io

Return values
int|null

The exit code or null for success

associateAwardsWithActivity()

Step 2: Associate all awards with Kingdom Court activity

protected associateAwardsWithActivity(int $activityId) : void
Parameters
$activityId : int

The Kingdom Court activity ID

buildOptionParser()

Hook method for defining this command's option parser.

protected buildOptionParser(ConsoleOptionParser $parser) : ConsoleOptionParser
Parameters
$parser : ConsoleOptionParser

The parser to be defined

Return values
ConsoleOptionParser

createGatheringsFromAwardEvents()

Steps 4-5: Create gatherings from award events and add Kingdom Court activity

protected createGatheringsFromAwardEvents(int $gatheringTypeId, int $activityId) : array<string|int, mixed>
Parameters
$gatheringTypeId : int

The gathering type ID

$activityId : int

The Kingdom Court activity ID

Return values
array<string|int, mixed>

Map of event_id => gathering_id

updateAwardRecommendations()

Steps 6-7: Update award recommendations to reference gatherings

protected updateAwardRecommendations(array<string|int, mixed> $eventGatheringMap) : void
Parameters
$eventGatheringMap : array<string|int, mixed>

Map of event_id => gathering_id


        
On this page

Search results