PlainDataResolver

class \TYPO3\CMS\Core\DataHandling\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  : int[]
$sortingStatement  : array|null
$tableName  : string
$workspaceId  : int

Methods

__construct()  : mixed
applyLiveIds()  : 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()  : int[]
processSorting()  : int[]
Processes sorting of the final result set, if a sorting statement (table column/expression) is given.
processVersionMovePlaceholders()  : int[]
Processes and resolves move placeholders on the final result set.
processVersionOverlays()  : 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()  : int[]
Re-indexes the given IDs.
sanitizeIds()  : array
Removes empty values (null, '0', 0, false).

Properties

$keepDeletePlaceholder

protected bool $keepDeletePlaceholder = false

$keepLiveIds

protected bool $keepLiveIds = false

$keepMovePlaceholder

protected bool $keepMovePlaceholder = true

$sortingStatement

protected array|null $sortingStatement

Methods

__construct()

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

Parameters

$tableName : string
$liveIds : int[]
$sortingStatement : array|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(int[] $ids) : int[]

Parameters

$ids : int[]

Return values

int[]

get()

public get() : int[]

Return values

int[]

processSorting()

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

public processSorting(int[] $ids) : int[]

Parameters

$ids : int[]

Return values

int[]

processVersionMovePlaceholders()

Processes and resolves move placeholders on the final result set.

public processVersionMovePlaceholders(int[] $ids) : int[]

Parameters

$ids : int[]

Return values

int[]

processVersionOverlays()

Processes version overlays on the final result set.

public processVersionOverlays(int[] $ids) : int[]

Parameters

$ids : int[]

Return values

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(int[] $ids) : int[]

Parameters

$ids : int[]

Return values

int[]

sanitizeIds()

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

protected sanitizeIds(int[] $ids) : array

Parameters

$ids : int[]

Return values

array
On this page