Skip to content

Commit 8345cf9

Browse files
[!!!][TASK] Merge FlexFormService into FlexFormTools (#6163)
* [!!!][TASK] Merge FlexFormService into FlexFormTools Resolves: TYPO3-Documentation/Changelog-To-Doc#1425 Releases: main * [FEATURE] Register Metadata Extractor Services via Interface Resolves: TYPO3-Documentation/Changelog-To-Doc#1411 Releases: main * [DOCS] Language check Releases: main --------- Co-authored-by: Sarah McCarthy <sarahmccarthy123@yahoo.com>
1 parent 155a9f1 commit 8345cf9

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

Documentation/ApiOverview/FlexForms/Reading/Index.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,23 @@ value is not defined in the plugin.
3838
3939
.. _read-flexforms-php:
4040

41-
FlexFormService: Read FlexForms values in PHP
42-
=============================================
41+
FlexFormTools: Read FlexForms values in PHP
42+
===========================================
4343

44-
You can use the :php-short:`\TYPO3\CMS\Extbase\Service\FlexFormService` to read
44+
.. deprecated:: 14.0
45+
Class :php-short:`\TYPO3\CMS\Core\Service\FlexFormService` has been merged
46+
into :php-short:`\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools`.
47+
48+
:php-short:`\TYPO3\CMS\Core\Service\FlexFormService` can be used with
49+
an alias up until TYPO3 v15.
50+
51+
You can use the :php:`\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools` to read
4552
the content of a FlexForm field.
4653

4754
This is useful in plain controllers without Extbase support, or in contexts
4855
like console commands or middleware where no settings are available.
4956

50-
:php:`FlexFormService->convertFlexFormContentToArray` returns an array that is
57+
:php:`FlexFormTools->convertFlexFormContentToArray` returns an array that is
5158
suitable for most use cases:
5259

5360
.. literalinclude:: _codesnippets/_NonExtbaseController.php

Documentation/ApiOverview/FlexForms/Reading/_codesnippets/_NonExtbaseController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44

55
namespace MyVendor\MyExtension\Mvc\Controller;
66

7-
use TYPO3\CMS\Core\Service\FlexFormService;
7+
use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
88

99
final readonly class NonExtbaseController
1010
{
11-
public function __construct(
12-
private FlexFormService $flexFormService,
13-
) {}
11+
public function __construct(private FlexFormTools $flexFormTools) {}
1412

1513
public function indexAction(array $ttContentRow): void
1614
{
@@ -23,6 +21,6 @@ private function loadFlexForm(string $field): array
2321
if ($field === '') {
2422
return [];
2523
}
26-
return $this->flexFormService->convertFlexFormContentToArray($field);
24+
return $this->flexFormTools->convertFlexFormContentToArray($field);
2725
}
2826
}

Documentation/ExtensionArchitecture/HowTo/UpdateExtensions/UpdateWizards/_SwitchableControllerActionUpgradeWizard.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace MyVendor\MyExtension\Upgrades;
66

7+
use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
78
use TYPO3\CMS\Core\Database\ConnectionPool;
8-
use TYPO3\CMS\Core\Service\FlexFormService;
99
use TYPO3\CMS\Install\Attribute\UpgradeWizard;
1010
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
1111

@@ -17,7 +17,7 @@ final class SwitchableControllerActionUpgradeWizard implements UpgradeWizardInte
1717

1818
public function __construct(
1919
private readonly ConnectionPool $connectionPool,
20-
private readonly FlexFormService $flexFormService,
20+
private readonly FlexFormTools $flexFormTools,
2121
) {}
2222

2323
public function getTitle(): string
@@ -75,7 +75,7 @@ private function migratePlugin(string $plugin, string $switchable, string $newCT
7575

7676
private function loadFlexForm(string $flexFormString): array
7777
{
78-
return $this->flexFormService
78+
return $this->flexFormTools
7979
->convertFlexFormContentToArray($flexFormString);
8080
}
8181

0 commit comments

Comments
 (0)