TYPO3 CMS  TYPO3_8-7
AbstractValidator.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 
22 
26 abstract class AbstractValidator implements ValidatorInterface
27 {
28 
33 
37  protected $currentElement;
38 
42  protected $sessionToken;
43 
47  protected $validationDto;
48 
55  {
56  $this->currentElement = $currentElement;
57  $this->sessionToken = $sessionToken;
58  $this->validationDto = $validationDto;
59  }
60 
67  protected function buildHmacDataPath(string $propertyPath): string
68  {
69  $pathParts = explode('.', $propertyPath);
70  $lastPathSegment = array_pop($pathParts);
71  $pathParts[] = '_orig_' . $lastPathSegment;
72 
73  return implode('.', $pathParts);
74  }
75 
80  {
81  return GeneralUtility::makeInstance(FormDefinitionValidationService::class);
82  }
83 
88  {
89  if (!($this->configurationService instanceof ConfigurationService)) {
90  $this->configurationService = $this->getObjectManager()->get(ConfigurationService::class);
91  }
93  }
94 
98  protected function getObjectManager(): ObjectManager
99  {
100  return GeneralUtility::makeInstance(ObjectManager::class);
101  }
102 }
__construct(array $currentElement, string $sessionToken, ValidationDto $validationDto)
static makeInstance($className,... $constructorArguments)