final class ContentStreamForPruning (View source)

internal  
 

This model reflects if content streams are currently in use or not. Each content stream is first CREATED or FORKED, and then moves to the IN_USE or REBASE_ERROR states; or is removed directly in case of temporary content streams.

FORKING: Content streams are forked from a base content stream. It can happen that the base content stream is NO_LONGER_IN_USE, but the child content stream is still IN_USE_BY_WORKSPACE. In this case, the base content stream can go to removed=true (removed from the content graph), but needs to be retained in the event store: If we do a full replay, we need the events of the base content stream before the fork happened to rebuild the child content stream. This logic is done in {\Neos\ContentRepository\Core\Service\ContentStreamPruner\ContentStreamPruner::findUnusedAndRemovedContentStreamIds()}.

TEMPORARY content streams: Projections should take care to dispose their temporary content streams, by triggering a ContentStreamWasRemoved event after the content stream is no longer used.

The different status a content stream can be in

       │                       │
       │(for root              │during
       │ content               │rebase
       ▼ stream)               ▼
 ┌──────────┐            ┌──────────┐             Temporary
 │ CREATED  │            │  FORKED  │────┐          status
 └──────────┘            └──────────┘    for
       │                       │      temporary
       ├───────────────────────┤       content
       ▼                       │       streams

┌───────────────────┐ │ │ │IN_USE_BY_WORKSPACE│ │ │ └───────────────────┘ │ │ Persistent │ │ │ status ▼ │ │ ┌───────────────────┐ │ │ │ NO_LONGER_IN_USE │ │ │ └───────────────────┘ │ │ │ │ │ └──────────┬────────────┘ │ ▼ │ ┌────────────────────────────────────────┐ │ │ removed=true │ │ │ => removed from content graph │◀─┘ └────────────────────────────────────────┘ Cleanup │ ▼ ┌────────────────────────────────────────┐ │ completely deleted from event stream │ └────────────────────────────────────────┘

Methods

create(ContentStreamId $id, DateTimeImmutable $created)

No description

createForked(ContentStreamId $id, ContentStreamId $sourceContentStreamId, DateTimeImmutable $created)

No description

withWorkspace(WorkspaceName $workspaceName)

No description

bool
isDangling()

No description

Details

static ContentStreamForPruning create(ContentStreamId $id, DateTimeImmutable $created)

No description

Parameters

ContentStreamId $id
DateTimeImmutable $created

Return Value

ContentStreamForPruning

static ContentStreamForPruning createForked(ContentStreamId $id, ContentStreamId $sourceContentStreamId, DateTimeImmutable $created)

No description

Parameters

ContentStreamId $id
ContentStreamId $sourceContentStreamId
DateTimeImmutable $created

Return Value

ContentStreamForPruning

ContentStreamForPruning withNoLongerInUse()

No description

ContentStreamForPruning withWorkspace(WorkspaceName $workspaceName)

No description

Parameters

WorkspaceName $workspaceName

Return Value

ContentStreamForPruning

ContentStreamForPruning withRemoved()

No description

bool isDangling()

No description

Return Value

bool