Skip to content
Snippets Groups Projects
Commit 3d243e6f authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[TASK] Add getter for TemplateService->rootId

The rootID holds the page ID where the root sys_template
record was found.

As this is crucial for some hooks this property
should be publically available but is marked as
deprecated during v9 development, a getter is added
to provide a public API.

Resolves: #83619
Releases: master
Change-Id: Ief651f2e2d758350f0620b3104dd47e0c06fa2f4
Reviewed-on: https://review.typo3.org/55415


Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent 1a9d307c
Branches
Tags
No related merge requests found
......@@ -53,7 +53,7 @@ class TemplateService
'allowedPaths' => 'Using $allowedPaths of class TemplateService from the outside is discouraged, as this variable is only used for internal storage.',
'simulationHiddenOrTime' => 'Using $simulationHiddenOrTime of class TemplateService is discouraged, as this has been superseeded by Doctrine DBAL API.',
'nextLevel' => 'Using $nextLevel of class TemplateService from the outside is discouraged, as this variable is only used for internal storage.',
'rootId' => 'Using $rootId of class TemplateService from the outside is discouraged, as this variable is only used for internal storage.',
'rootId' => 'Using $rootId of class TemplateService from the outside is discouraged, use TemplateService->getRootId() instead.',
'absoluteRootLine' => 'Using $absoluteRootLine of class TemplateService from the outside is discouraged, as this variable is only used for internal storage.',
'outermostRootlineIndexWithTemplate' => 'Using $outermostRootlineIndexWithTemplate of class TemplateService from the outside is discouraged, as this variable is only used for internal storage.',
'rowSum' => 'Using $rowSum of class TemplateService from the outside is discouraged, as this variable is only used for internal storage.',
......@@ -1447,6 +1447,16 @@ class TemplateService
return false;
}
/**
* Returns the page ID of the rootlevel
*
* @return int
*/
public function getRootId(): int
{
return (int)$this->rootId;
}
/*******************************************************************
*
* Functions for creating links
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment