interface ContentGraphProjectionInterface implements ProjectionInterface (View source)

Methods

void
setUp()

Set up the projection state (create/update required database tables, ...).

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

getState()

NOTE: The state will be accessed eagerly ONCE upon initialisation of the content repository and put into the immutable {ProjectionStates} collection.

void
resetState()

No description

mixed
inSimulation(Closure $fn)

Dedicated method for simulated rebasing

Details

void setUp()

Set up the projection state (create/update required database tables, ...).

Return Value

void

ProjectionStatus status()

Determines the setup status of the projection. E.g. are the database tables created or any columns missing.

Return Value

ProjectionStatus

void apply(EventInterface $event, EventEnvelope $eventEnvelope)

No description

Parameters

EventInterface $event
EventEnvelope $eventEnvelope

Return Value

void

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

Return Value

void

mixed inSimulation(Closure $fn)

Dedicated method for simulated rebasing

The implementation must ensure that the function passed is invoked and that any changes via {\Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphProjectionInterface::apply()} are executed "in simulation" e.g. NOT persisted after returning.

The projection state {\Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphReadModelInterface} must reflect the current changes of the simulation as well during the execution of the function.

This is generally done by leveraging a transaction and rollback.

Used to simulate commands for publishing: {\Neos\ContentRepository\Core\CommandHandler\CommandSimulator}

Parameters

Closure $fn

Return Value

mixed

the return value of $fn