5.1.5.1. Baleen\Migrations\Timeline\AbstractTimeline

class AbstractTimeline

Encapsulates the lower-level methods of a Timeline, leaving the actual timeline logic to the extending class.

property emitter

protected PublisherInterface

__construct(Linked $versions, MigrationBus $migrationBus = null)
Parameters:
  • $versions (Linked) –
  • $migrationBus (MigrationBus) – A CommandBus that will be used to run each individual migration.
shouldMigrate(DeltaInterface $version, OptionsInterface $options)

Returns true if the operatin is forced, or if the direction is the opposite to the state of the migration.

Parameters:
Returns:

bool

createEmitter()

Must create and return a default specialised dispatcher.

Returns:BaleenMigrationsSharedEventPublisherInterface
doRun(MigrationInterface $migration, OptionsInterface $options)
Parameters:
Returns:

bool

runCollection(DeltaInterface $goalVersion, OptionsInterface $options, Linked $collection)

Executes migrations against a collection

Parameters:
Returns:

Linked

getVersions()

getVersions

Returns:Linked
setEventDispatcher(EventDispatcherInterface $eventDispatcher)

Set the EventDispatcher for the emitter. This is public to allow attaching a previously existing EventDispatcher.

Parameters:
  • $eventDispatcher (EventDispatcherInterface) –
getEmitter()

Returns the emitter for the class. Creates one if necessary.

Returns:PublisherInterface
setEmitter(PublisherInterface $emitter)

Sets the emitter for the class.

Parameters:
getEventDispatcher()

Get the event dispatcher from the emitter.

Returns:EventDispatcherInterface
upTowards($version, OptionsInterface $options)

Runs all versions up, starting from the oldest and until (and including) the specified version.

Parameters:
downTowards($version, OptionsInterface $options)

Runs all versions down, starting from the newest and until (and including) the specified version.

Parameters:
goTowards($goalVersion, OptionsInterface $options)

Runs migrations up/down so that all versions before and including the specified version are “up” and all versions after the specified version are “down”.

Parameters:
runSingle(DeltaInterface $version, OptionsInterface $options, Progress $progress)

Runs a single migration in the specified direction.

Parameters:
Returns:

DeltaInterface|false