TYPO3CMS
9.5
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
$
d
e
r
u
Functions
Variables
$
e
r
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
ContentDataProcessor.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Frontend\ContentObject
;
3
4
/*
5
* This file is part of the TYPO3 CMS project.
6
*
7
* It is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU General Public License, either version 2
9
* of the License, or any later version.
10
*
11
* For the full copyright and license information, please read the
12
* LICENSE.txt file that was distributed with this source code.
13
*
14
* The TYPO3 project - inspiring people to share!
15
*/
16
17
use
TYPO3\CMS\Core\Utility\ArrayUtility
;
18
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
19
23
class
ContentDataProcessor
24
{
34
public
function
process
(
ContentObjectRenderer
$cObject, array $configuration, array $variables)
35
{
36
if
(
37
!empty($configuration[
'dataProcessing.'
])
38
&& is_array($configuration[
'dataProcessing.'
])
39
) {
40
$processors = $configuration[
'dataProcessing.'
];
41
$processorKeys =
ArrayUtility::filterAndSortByNumericKeys
($processors);
42
43
foreach
($processorKeys as $key) {
44
$className = $processors[$key];
45
if
(!class_exists($className)) {
46
throw
new \UnexpectedValueException(
'Processor class name "'
. $className .
'" does not exist!'
, 1427455378);
47
}
48
49
if
(!in_array(DataProcessorInterface::class, class_implements($className),
true
)) {
50
throw
new \UnexpectedValueException(
51
'Processor with class name "'
. $className .
'" '
.
52
'must implement interface "'
. DataProcessorInterface::class .
'"'
,
53
1427455377
54
);
55
}
56
57
$processorConfiguration = $processors[$key .
'.'
] ?? [];
58
59
$variables = GeneralUtility::makeInstance($className)->process(
60
$cObject,
61
$configuration,
62
$processorConfiguration,
63
$variables
64
);
65
}
66
}
67
68
return
$variables;
69
}
70
}
TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor
Definition:
ContentDataProcessor.php:24
TYPO3\CMS\Frontend\ContentObject
Definition:
AbstractContentObject.php:2
TYPO3\CMS\Core\Utility\ArrayUtility
Definition:
ArrayUtility.php:23
TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition:
ContentObjectRenderer.php:91
TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor\process
array process(ContentObjectRenderer $cObject, array $configuration, array $variables)
Definition:
ContentDataProcessor.php:34
TYPO3\CMS\Core\Utility\GeneralUtility
Definition:
GeneralUtility.php:45
TYPO3\CMS\Core\Utility\ArrayUtility\filterAndSortByNumericKeys
static array filterAndSortByNumericKeys($setupArr, $acceptAnyKeys=false)
Definition:
ArrayUtility.php:772
doxygen
typo3
sysext
frontend
Classes
ContentObject
ContentDataProcessor.php
Generated on Tue Oct 5 2021 01:57:42 for TYPO3CMS by
1.8.18