PlainDataResolver

Resolves a given set of record IDs to the IDs that are relevant in a target workspace.

Callers hand over a flat list of live record IDs and receive a flat list of IDs back. Everything happens on a plain/raw database level: no records are instantiated and no TCA-based processing takes place, fetching the actual rows is left to the caller.

get() applies the following steps, in this order:

  • move pointers and version overlays are substituted for the target workspace, delete placeholders are dropped unless setKeepDeletePlaceholder() says otherwise
  • the result is re-sorted, if a sorting statement was given to the constructor
  • resolved version IDs are mapped back to their live counterparts, if setKeepLiveIds() is enabled

This class resolves the workspace context only. It deliberately does not deal with languages: language overlays and fallback chains are applied in a separate, later step by PageRepository->getLanguageOverlay(), which for the record API is orchestrated by GreedyDatabaseBackend. Language handling must not be added here, it would duplicate that layer and risk overlaying records twice.

Typical use cases:

  • RelationHandler resolves the children of a relational field to their workspace versions
  • DataHandler->copySpecificPage() and ->int_pageTreeInfo() traverse pages in a workspace
  • PageTreeRepository renders the backend page tree in a workspace
  • VersionToLiveIdMap builds a version-to-live ID map, calling applyLiveIds() directly

get() is the regular entry point. The single processing steps are marked @internal and are only meant for callers that need one specific aspect, such as the mapping above.

Table of Contents

Properties

$keepDeletePlaceholder  : bool
$keepLiveIds  : bool
$keepMovePlaceholder  : bool
$liveIds  : array<string|int, int>
$sortingStatement  : array<string|int, mixed>|null
$tableName  : string
$workspaceId  : int

Methods

__construct()  : mixed
applyLiveIds()  : array<string|int, int>
Applies live IDs to the final result set, if the current table is enabled for workspaces and the keepLiveIds class member is enabled.
get()  : array<string|int, int>
processSorting()  : array<string|int, int>
Processes sorting of the final result set, if a sorting statement (table column/expression) is given.
processVersionMovePlaceholders()  : array<string|int, int>
Processes and resolves move placeholders on the final result set.
processVersionOverlays()  : array<string|int, int>
Processes version overlays on the final result set.
setKeepDeletePlaceholder()  : PlainDataResolver
Sets whether delete placeholders shall be kept in the final result set.
setKeepLiveIds()  : PlainDataResolver
Sets whether live IDs shall be kept in the final result set.
setKeepMovePlaceholder()  : PlainDataResolver
Sets whether move placeholders shall be kept in case they cannot be substituted.
setWorkspaceId()  : mixed
Sets the target workspace ID the final result shall use.
isWorkspaceEnabled()  : bool
reindex()  : array<string|int, int>
Re-indexes the given IDs.
sanitizeIds()  : array<string|int, mixed>
Removes empty values (null, '0', 0, false).

Properties

$keepDeletePlaceholder

protected bool $keepDeletePlaceholder = false

$keepLiveIds

protected bool $keepLiveIds = false

$keepMovePlaceholder

protected bool $keepMovePlaceholder = true

$liveIds

protected array<string|int, int> $liveIds

$sortingStatement

protected array<string|int, mixed>|null $sortingStatement

Methods

__construct()

public __construct(string $tableName, array<string|int, int> $liveIds[, array<string|int, mixed>|null $sortingStatement = null ]) : mixed
Parameters
$tableName : string
$liveIds : array<string|int, int>
$sortingStatement : array<string|int, mixed>|null = null

applyLiveIds()

Applies live IDs to the final result set, if the current table is enabled for workspaces and the keepLiveIds class member is enabled.

public applyLiveIds(array<string|int, int> $ids) : array<string|int, int>
Parameters
$ids : array<string|int, int>
Internal
Return values
array<string|int, int>

get()

public get() : array<string|int, int>
Return values
array<string|int, int>

processSorting()

Processes sorting of the final result set, if a sorting statement (table column/expression) is given.

public processSorting(array<string|int, int> $ids) : array<string|int, int>
Parameters
$ids : array<string|int, int>
Internal
Return values
array<string|int, int>

processVersionMovePlaceholders()

Processes and resolves move placeholders on the final result set.

public processVersionMovePlaceholders(array<string|int, int> $ids) : array<string|int, int>
Parameters
$ids : array<string|int, int>
Internal
Return values
array<string|int, int>

processVersionOverlays()

Processes version overlays on the final result set.

public processVersionOverlays(array<string|int, int> $ids) : array<string|int, int>
Parameters
$ids : array<string|int, int>
Internal
Return values
array<string|int, int>

setKeepDeletePlaceholder()

Sets whether delete placeholders shall be kept in the final result set.

public setKeepDeletePlaceholder(bool $keepDeletePlaceholder) : PlainDataResolver
Parameters
$keepDeletePlaceholder : bool
Return values
PlainDataResolver

setKeepMovePlaceholder()

Sets whether move placeholders shall be kept in case they cannot be substituted.

public setKeepMovePlaceholder(bool $keepMovePlaceholder) : PlainDataResolver
Parameters
$keepMovePlaceholder : bool
Return values
PlainDataResolver

setWorkspaceId()

Sets the target workspace ID the final result shall use.

public setWorkspaceId(int $workspaceId) : mixed
Parameters
$workspaceId : int

isWorkspaceEnabled()

protected isWorkspaceEnabled() : bool
Return values
bool

reindex()

Re-indexes the given IDs.

protected reindex(array<string|int, int> $ids) : array<string|int, int>
Parameters
$ids : array<string|int, int>
Return values
array<string|int, int>

sanitizeIds()

Removes empty values (null, '0', 0, false).

protected sanitizeIds(array<string|int, int> $ids) : array<string|int, mixed>
Parameters
$ids : array<string|int, int>
Return values
array<string|int, mixed>
On this page

Search results