SysTemplateRepository
Fetch relevant sys_template records from database by given page rootline.
The result sys_template rows are fed to the SysTemplateTreeBuilder for processing.
Tags
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Methods
- __construct() : mixed
- getSysTemplateRowsByRootline() : array<string|int, mixed>
- To calculate the TS include tree, we have to find sys_template rows attached to all rootline pages.
- getSysTemplateRowsByRootlineWithUidOverride() : array<string|int, mixed>
- To calculate the TS include tree, we have to find sys_template rows attached to all rootline pages.
Methods
__construct()
public
__construct(EventDispatcherInterface $eventDispatcher, ConnectionPool $connectionPool, Context $context) : mixed
Parameters
- $eventDispatcher : EventDispatcherInterface
- $connectionPool : ConnectionPool
- $context : Context
getSysTemplateRowsByRootline()
To calculate the TS include tree, we have to find sys_template rows attached to all rootline pages.
public
getSysTemplateRowsByRootline(array<string|int, mixed> $rootline[, ServerRequestInterface|null $request = null ]) : array<string|int, mixed>
When there are multiple active sys_template rows on a page, we pick the one with the lower sorting value.
The query implementation below does that with one query for all rootline pages at once, not one query per page. To handle the capabilities mentioned above, the query is a bit nifty, but the implementation should scale nearly O(1) instead of O(n) with the rootline depth.
Parameters
- $rootline : array<string|int, mixed>
- $request : ServerRequestInterface|null = null
-
Nullable since Request is not a hard dependency ond just convenient for the Event
Tags
Return values
array<string|int, mixed>getSysTemplateRowsByRootlineWithUidOverride()
To calculate the TS include tree, we have to find sys_template rows attached to all rootline pages.
public
getSysTemplateRowsByRootlineWithUidOverride(array<string|int, mixed> $rootline, ServerRequestInterface|null $request, int $templateUidOnDeepestRootline) : array<string|int, mixed>
When there are multiple active sys_template rows on a page, we pick the one with the lower sorting value.
This variant is tailored for ext:tstemplate use. It allows "overriding" the sys_template uid of the deepest page, which is used when multiple sys_template records on one page are managed in the Backend.
The query implementation below does that with one query for all rootline pages at once, not one query per page. To handle the capabilities mentioned above, the query is a bit nifty, but the implementation should scale nearly O(1) instead of O(n) with the rootline depth.
Parameters
- $rootline : array<string|int, mixed>
- $request : ServerRequestInterface|null
- $templateUidOnDeepestRootline : int