‪TYPO3CMS  9.5
FinisherOptionsFlexFormOverridesConverter.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
20 
27 {
31  protected ‪$converterDto;
32 
37  {
38  $this->converterDto = ‪$converterDto;
39  }
40 
53  public function ‪__invoke(string $_, $__, array $matches): void
54  {
55  [, $optionKey] = $matches;
56  $finisherDefinition = $this->converterDto->getFinisherDefinition();
57  $finisherIdentifier = $this->converterDto->getFinisherIdentifier();
58  $flexFormSheetSettings = $this->converterDto->getFlexFormSheetSettings();
59 
60  try {
62  $flexFormSheetSettings['finishers'][$finisherIdentifier],
63  $optionKey,
64  '.'
65  );
66  } catch (‪MissingArrayPathException $exception) {
67  return;
68  }
69 
70  $finisherDefinition = ‪ArrayUtility::setValueByPath($finisherDefinition, 'options.' . $optionKey, $value, '.');
71 
72  $this->converterDto->setFinisherDefinition($finisherDefinition);
73  }
74 }
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters\FinisherOptionsFlexFormOverridesConverter\__construct
‪__construct(FlexFormFinisherOverridesConverterDto $converterDto)
Definition: FinisherOptionsFlexFormOverridesConverter.php:35
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters
Definition: AbstractConverter.php:3
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters\FinisherOptionsFlexFormOverridesConverter
Definition: FinisherOptionsFlexFormOverridesConverter.php:27
‪TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException
Definition: MissingArrayPathException.php:26
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters\FinisherOptionsFlexFormOverridesConverter\$converterDto
‪FlexFormFinisherOverridesConverterDto $converterDto
Definition: FinisherOptionsFlexFormOverridesConverter.php:30
‪TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath
‪static mixed getValueByPath(array $array, $path, $delimiter='/')
Definition: ArrayUtility.php:179
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters\FinisherOptionsFlexFormOverridesConverter\__invoke
‪__invoke(string $_, $__, array $matches)
Definition: FinisherOptionsFlexFormOverridesConverter.php:52
‪TYPO3\CMS\Core\Utility\ArrayUtility\setValueByPath
‪static array setValueByPath(array $array, $path, $value, $delimiter='/')
Definition: ArrayUtility.php:271
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:23
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters\FlexFormFinisherOverridesConverterDto
Definition: FlexFormFinisherOverridesConverterDto.php:22