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: - $version (DeltaInterface) –
- $options (OptionsInterface) –
Returns: bool
-
createEmitter
()¶ Must create and return a default specialised dispatcher.
Returns: BaleenMigrationsSharedEventPublisherInterface
-
doRun
(MigrationInterface $migration, OptionsInterface $options)¶ Parameters: - $migration (MigrationInterface) –
- $options (OptionsInterface) –
Returns: bool
-
runCollection
(DeltaInterface $goalVersion, OptionsInterface $options, Linked $collection)¶ Executes migrations against a collection
Parameters: - $goalVersion (DeltaInterface) –
- $options (OptionsInterface) –
- $collection (Linked) –
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: - $emitter (PublisherInterface) –
-
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: - $version (string|DeltaInterface) –
- $options (OptionsInterface) –
-
downTowards
($version, OptionsInterface $options)¶ Runs all versions down, starting from the newest and until (and including) the specified version.
Parameters: - $version (string|DeltaInterface) –
- $options (OptionsInterface) –
-
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: - $goalVersion (string|DeltaInterface) –
- $options (OptionsInterface) –
-
runSingle
(DeltaInterface $version, OptionsInterface $options, Progress $progress)¶ Runs a single migration in the specified direction.
Parameters: - $version (DeltaInterface) –
- $options (OptionsInterface) –
- $progress (Progress) –
Returns: DeltaInterface|false
-
property