Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Provide compatibility method for Extbase repositories
- Loading branch information
1 parent
1073542
commit f710ff0
Showing
6 changed files
with
151 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.. include:: ../Includes.txt | ||
|
||
.. _extbase-repositories: | ||
|
||
==================== | ||
Extbase repositories | ||
==================== | ||
|
||
.. versionadded:: 0.7.3 | ||
|
||
`Feature: #23 - Provide compatibility method for Extbase repositories <https://github.com/CPS-IT/handlebars/pull/23>`__ | ||
|
||
.. warning:: | ||
|
||
**Use of the** `AbstractDataProcessor` **required** | ||
|
||
This compatibility method is only applicable to `DataProcessors` | ||
that extend the :php:`AbstractDataProcessor`, since it provides the | ||
necessary method. It is not part of the :php:`DataProcessorInterface`. | ||
|
||
When Extbase repositories are used to fetch data via the `DataProvider`, | ||
it may be necessary to perform the necessary bootstrapping for Extbase | ||
repositories. This is the case whenever the rendering process is executed | ||
outside the Extbase context and fields such as `tt_content.pages` or | ||
`tt_content.recursive` are to be accessed in the repository to determine | ||
the storage PIDs. | ||
|
||
To execute the necessary bootstrapping or to reset the underlying | ||
:php:`ConfigurationManager` and to fill it with the current | ||
:php:`ContentObjectRenderer`, the method | ||
:php:`initializeConfigurationManager()` must be executed in the | ||
`DataProcessor`. | ||
|
||
.. _extbase-repositories-usage: | ||
|
||
Usage | ||
===== | ||
|
||
.. code-block:: diff | ||
# Classes/DataProcessing/HeaderProcessor.php | ||
namespace Vendor\Extension\DataProcessing; | ||
use Fr\Typo3Handlebars\DataProcessing\AbstractDataProcessor; | ||
class HeaderProcessor extends AbstractDataProcessor | ||
{ | ||
protected function render(): string | ||
{ | ||
+ $this->initializeConfigurationManager(); | ||
$data = $this->provider->get($this->cObj->data); | ||
return $this->presenter->present($data); | ||
} | ||
} | ||
.. _extbase-repositories-sources: | ||
|
||
Sources | ||
======= | ||
|
||
.. seealso:: | ||
|
||
View the sources on GitHub: | ||
|
||
- `AbstractDataProcessor <https://github.com/CPS-IT/handlebars/blob/master/Classes/DataProcessing/AbstractDataProcessor.php>`__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ for compatibility with other TYPO3 components. | |
:maxdepth: 1 | ||
|
||
ExtbaseControllers | ||
ExtbaseRepositories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters