ProjectionInterface
interface ProjectionInterface (View source)
Common interface for a Content Repository projection. This API is NOT exposed to the outside world, but is the contract between {ContentRepository} and the individual projections.
Methods
Set up the projection state (create/update required database tables, ...).
Determines the setup status of the projection. E.g. are the database tables created or any columns missing.
NOTE: The state will be accessed eagerly ONCE upon initialisation of the content repository and put into the immutable {ProjectionStates} collection.
No description
Details
void
setUp()
Set up the projection state (create/update required database tables, ...).
ProjectionStatus
status()
Determines the setup status of the projection. E.g. are the database tables created or any columns missing.
void
apply(EventInterface $event, EventEnvelope $eventEnvelope)
No description
ProjectionStateInterface
getState()
NOTE: The state will be accessed eagerly ONCE upon initialisation of the content repository and put into the immutable {ProjectionStates} collection.
This ensures always the same instance is being returned when accessing it.
Projections should on construction already have the state prepared, that also for internal use cases the SAME INSTANCE is always used.
void
resetState()
No description