RootlineUtility
A utility resolving and Caching the Rootline generation
Table of Contents
Constants
- RUNTIME_CACHE_TAG = 'rootline-utility'
Properties
- $cache : FrontendInterface
- $cacheIdentifier : string
- $context : Context
- Query context
- $languageUid : int
- $mountPointParameter : string
- $pageRepository : PageRepository
- Database Query Object
- $pageUid : int
- $parsedMountPointParameters : array<string|int, int>
- $rootlineFields : array<string|int, string>
- Default fields to fetch when populating rootline data, will be merged dynamically with $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] in getRecordArray().
- $runtimeCache : FrontendInterface
- $workspaceUid : int
Methods
- __construct() : mixed
- get() : array<string|int, mixed>
- Returns the actual rootline without the tree root (uid=0), including the page with $this->pageUid
- getCacheIdentifier() : string
- Constructs the cache Identifier
- isMountedPage() : bool
- Checks whether the current Page is a Mounted Page (according to the MP-URL-Parameter)
- columnHasRelationToResolve() : bool
- Checks whether the TCA Configuration array of a column describes a relation which is not stored as CSV in the record
- createQueryBuilder() : QueryBuilder
- enrichWithRelationFields() : array<string, string|int|float|null>
- Resolve relations as defined in TCA and add them to the provided $pageRecord array.
- generateRootlineCache() : void
- Actual function to generate the rootline and cache it
- getRecordArray() : array<string, string|int|float|null>
- Queries the database for the page record and returns it.
- parseMountPointParameter() : void
- Parse the MountPoint Parameters Splits the MP-Param via "," for several nested mountpoints and afterwords registers the mountpoint configurations
- processMountedPage() : array<string, string|int|float|null>
- Enhances with mount point information or replaces the node if needed
- resolveMovePointerId() : int|null
- Fetched the UID of the versioned record if the live record has been moved in a workspace.
- resolvePageId() : int
- Fetches the UID of the page.
- resolvePageRecord() : array<string|int, mixed>|null
- sanitizeMountPointParameter() : string
- Sanitize the MountPoint Parameter Splits the MP-Param via "," and removes mountpoints that don't have the format \d+-\d+
Constants
RUNTIME_CACHE_TAG
public
mixed
RUNTIME_CACHE_TAG
= 'rootline-utility'
Properties
$cache
protected
FrontendInterface
$cache
$cacheIdentifier
protected
string
$cacheIdentifier
$context
Query context
protected
Context
$context
$languageUid
protected
int
$languageUid
= 0
$mountPointParameter
protected
string
$mountPointParameter
$pageRepository
Database Query Object
protected
PageRepository
$pageRepository
$pageUid
protected
int
$pageUid
$parsedMountPointParameters
protected
array<string|int, int>
$parsedMountPointParameters
= []
$rootlineFields
Default fields to fetch when populating rootline data, will be merged dynamically with $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] in getRecordArray().
protected
array<string|int, string>
$rootlineFields
= ['pid', 'uid', 't3ver_oid', 't3ver_wsid', 't3ver_state', 'title', 'nav_title', 'media', 'layout', 'hidden', 'starttime', 'endtime', 'fe_group', 'extendToSubpages', 'doktype', 'TSconfig', 'tsconfig_includes', 'is_siteroot', 'mount_pid', 'mount_pid_ol', 'backend_layout_next_level']
Tags
$runtimeCache
protected
FrontendInterface
$runtimeCache
$workspaceUid
protected
int
$workspaceUid
= 0
Methods
__construct()
public
__construct(int $uid[, string $mountPointParameter = '' ][, Context|null $context = null ]) : mixed
Parameters
- $uid : int
- $mountPointParameter : string = ''
- $context : Context|null = null
Tags
get()
Returns the actual rootline without the tree root (uid=0), including the page with $this->pageUid
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed>getCacheIdentifier()
Constructs the cache Identifier
public
getCacheIdentifier([int|null $otherUid = null ]) : string
Parameters
- $otherUid : int|null = null
Return values
stringisMountedPage()
Checks whether the current Page is a Mounted Page (according to the MP-URL-Parameter)
public
isMountedPage() : bool
Return values
boolcolumnHasRelationToResolve()
Checks whether the TCA Configuration array of a column describes a relation which is not stored as CSV in the record
protected
columnHasRelationToResolve(array<string|int, mixed> $configuration) : bool
Parameters
- $configuration : array<string|int, mixed>
-
TCA configuration to check
Return values
bool —TRUE, if it describes a non-CSV relation
createQueryBuilder()
protected
createQueryBuilder(string $tableName) : QueryBuilder
Parameters
- $tableName : string
Return values
QueryBuilderenrichWithRelationFields()
Resolve relations as defined in TCA and add them to the provided $pageRecord array.
protected
enrichWithRelationFields(int $uid, array<string, string|int|float|null> $pageRecord) : array<string, string|int|float|null>
Parameters
- $uid : int
-
page ID
- $pageRecord : array<string, string|int|float|null>
-
Page record (possibly overlaid) to be extended with relations
Tags
Return values
array<string, string|int|float|null> —$pageRecord with additional relations
generateRootlineCache()
Actual function to generate the rootline and cache it
protected
generateRootlineCache() : void
Tags
getRecordArray()
Queries the database for the page record and returns it.
protected
getRecordArray(int $uid) : array<string, string|int|float|null>
Parameters
- $uid : int
-
Page id
Tags
Return values
array<string, string|int|float|null> —The array will contain the fields listed in the $rootlineFields static property.
parseMountPointParameter()
Parse the MountPoint Parameters Splits the MP-Param via "," for several nested mountpoints and afterwords registers the mountpoint configurations
protected
parseMountPointParameter() : void
processMountedPage()
Enhances with mount point information or replaces the node if needed
protected
processMountedPage(array<string, string|int|float|null> $mountedPageData, array<string, string|int|float|null> $mountPointPageData) : array<string, string|int|float|null>
Parameters
- $mountedPageData : array<string, string|int|float|null>
-
page record array of mounted page
- $mountPointPageData : array<string, string|int|float|null>
-
page record array of mount point page
Tags
Return values
array<string, string|int|float|null>resolveMovePointerId()
Fetched the UID of the versioned record if the live record has been moved in a workspace.
protected
resolveMovePointerId(int $liveId) : int|null
Parameters
- $liveId : int
Return values
int|nullresolvePageId()
Fetches the UID of the page.
protected
resolvePageId(int $pageId) : int
If the page was moved in a workspace, actually returns the UID of the moved version in the workspace.
Parameters
- $pageId : int
Return values
intresolvePageRecord()
protected
resolvePageRecord(int $pageId) : array<string|int, mixed>|null
Parameters
- $pageId : int
Return values
array<string|int, mixed>|nullsanitizeMountPointParameter()
Sanitize the MountPoint Parameter Splits the MP-Param via "," and removes mountpoints that don't have the format \d+-\d+
protected
sanitizeMountPointParameter(string $mountPointParameter) : string
Parameters
- $mountPointParameter : string