1 | <?php |
||
34 | class Typo3Service implements SingletonInterface |
||
35 | { |
||
36 | /** |
||
37 | * @var Sequenzer |
||
38 | */ |
||
39 | private $sequenzer; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | private $conf; |
||
45 | |||
46 | /** |
||
47 | * array of configured tables that should call the sequenzer |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | private $supportedTables; |
||
52 | |||
53 | /** |
||
54 | * @param Sequenzer $sequenzer |
||
55 | */ |
||
56 | 3 | public function __construct(Sequenzer $sequenzer) |
|
67 | |||
68 | /** |
||
69 | * Modify a TYPO3 insert array (key -> value) , and adds the uid that should be forced during INSERT |
||
70 | * |
||
71 | * @param string $tableName |
||
72 | * @param array $fields_values |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | 2 | public function modifyInsertFields($tableName, array $fields_values): array |
|
77 | { |
||
78 | 2 | if (false === $this->needsSequenzer($tableName)) { |
|
79 | 1 | return $fields_values; |
|
80 | } |
||
81 | |||
82 | // How to test this when no exception is thrown ? |
||
83 | 1 | if (isset($fields_values['uid'])) { |
|
84 | $e = new \Exception('', 1512378232); |
||
85 | GeneralUtility::devLog( |
||
|
|||
86 | 'UID ' . $fields_values['uid'] . ' is already set for table "' . $tableName . '"', |
||
87 | 'aoe_dbsequenzer', |
||
88 | 2, |
||
89 | $e->getTraceAsString() |
||
90 | ); |
||
91 | } else { |
||
92 | 1 | $fields_values['uid'] = $this->sequenzer->getNextIdForTable($tableName); |
|
93 | } |
||
94 | |||
95 | 1 | return $fields_values; |
|
96 | } |
||
97 | |||
98 | /** |
||
99 | * If a table is configured to use the sequenzer |
||
100 | * |
||
101 | * @param string $tableName |
||
102 | * @return boolean |
||
103 | */ |
||
104 | 2 | public function needsSequenzer($tableName) |
|
108 | } |
||
109 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.