‪TYPO3CMS  9.5
FormState.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 originated from the Neos.Form package (www.neos.io)
9  *
10  * It is free software; you can redistribute it and/or modify it under
11  * the terms of the GNU General Public License, either version 2
12  * of the License, or any later version.
13  *
14  * For the full copyright and license information, please read the
15  * LICENSE.txt file that was distributed with this source code.
16  *
17  * The TYPO3 project - inspiring people to share!
18  */
19 
22 
32 {
33 
38  const ‪NOPAGE = -1;
39 
46 
50  protected ‪$formValues = [];
51 
55  public function ‪isFormSubmitted(): bool
56  {
57  return $this->lastDisplayedPageIndex !== ‪self::NOPAGE;
58  }
59 
63  public function ‪getLastDisplayedPageIndex(): int
64  {
66  }
67 
72  {
73  $this->lastDisplayedPageIndex = ‪$lastDisplayedPageIndex;
74  }
75 
79  public function ‪getFormValues(): array
80  {
81  return ‪$this->formValues;
82  }
83 
88  public function ‪setFormValue(string $propertyPath, $value)
89  {
90  $this->formValues = ‪ArrayUtility::setValueByPath(
91  $this->formValues,
92  $propertyPath,
93  $value,
94  '.'
95  );
96  }
97 
102  public function ‪getFormValue(string $propertyPath)
103  {
104  try {
105  return ‪ArrayUtility::getValueByPath($this->formValues, $propertyPath, '.');
106  } catch (MissingArrayPathException $exception) {
107  return null;
108  }
109  }
110 }
‪TYPO3\CMS\Form\Domain\Runtime\FormState\setFormValue
‪setFormValue(string $propertyPath, $value)
Definition: FormState.php:86
‪TYPO3\CMS\Form\Domain\Runtime\FormState\isFormSubmitted
‪bool isFormSubmitted()
Definition: FormState.php:53
‪TYPO3\CMS\Form\Domain\Runtime\FormState\NOPAGE
‪const NOPAGE
Definition: FormState.php:38
‪TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException
Definition: MissingArrayPathException.php:26
‪TYPO3\CMS\Form\Domain\Runtime\FormState\$formValues
‪array $formValues
Definition: FormState.php:48
‪TYPO3\CMS\Form\Domain\Runtime\FormState
Definition: FormState.php:32
‪TYPO3\CMS\Form\Domain\Runtime\FormState\setLastDisplayedPageIndex
‪setLastDisplayedPageIndex(int $lastDisplayedPageIndex)
Definition: FormState.php:69
‪TYPO3\CMS\Form\Domain\Runtime\FormState\$lastDisplayedPageIndex
‪int $lastDisplayedPageIndex
Definition: FormState.php:44
‪TYPO3\CMS\Form\Domain\Runtime
‪TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath
‪static mixed getValueByPath(array $array, $path, $delimiter='/')
Definition: ArrayUtility.php:179
‪TYPO3\CMS\Form\Domain\Runtime\FormState\getFormValue
‪mixed getFormValue(string $propertyPath)
Definition: FormState.php:100
‪TYPO3\CMS\Form\Domain\Runtime\FormState\getFormValues
‪array getFormValues()
Definition: FormState.php:77
‪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\Runtime\FormState\getLastDisplayedPageIndex
‪int getLastDisplayedPageIndex()
Definition: FormState.php:61