Post-process record data for the table that this ConfigurationProvider
is attached to.
public postProcessRecord ( string $operation, integer $id, array &$row, TYPO3\CMS\Core\DataHandling\DataHandler $reference, array $removals = [] ) : void | ||
$operation | string | TYPO3 operation identifier, i.e. "update", "new" etc. |
$id | integer | The ID of the current record (which is sometimes now included in $row |
$row | array | the record data, by reference. Changing fields' values changes the record's values just before saving |
$reference | TYPO3\CMS\Core\DataHandling\DataHandler | A reference to the \TYPO3\CMS\Core\DataHandling\DataHandler object that is currently saving the record |
$removals | array | Allows overridden methods to pass an additional array of field names to remove from the stored Flux value |
return | void |
/** * @param string $operation * @param integer $id * @param array $row * @param DataHandler $reference * @param array $removals Allows overridden methods to pass an additional array of field names to remove from the stored Flux value * @return void */ public function postProcessRecord($operation, $id, array &$row, DataHandler $reference, array $removals = array()) { if (TRUE === self::shouldCallWithClassName(__CLASS__, __FUNCTION__, $id)) { parent::postProcessRecord($operation, $id, $row, $reference, $removals); $parameters = GeneralUtility::_GET(); $this->contentService->affectRecordByRequestParameters($id, $row, $parameters, $reference); self::trackMethodCallWithClassName(__CLASS__, __FUNCTION__, $id); } }
/** * @param string $operation * @param integer $id * @param array $row * @param DataHandler $reference * @param array $removals Additional array of field names to remove from the stored Flux value */ public function postProcessRecord($operation, $id, array &$row, DataHandler $reference, array $removals = []) { if ('update' === $operation) { $record = $this->loadRecordFromDatabase($id); $record = RecursiveArrayUtility::mergeRecursiveOverrule($record, $reference->datamap[$this->tableName][$id]); $form = $this->getForm($record); if (null !== $form) { $tableFieldName = $this->getFieldName($record); foreach ($form->getFields() as $field) { $fieldName = $field->getName(); $sheetName = $field->getParent()->getName(); $inherit = (bool) $field->getInherit(); $inheritEmpty = (bool) $field->getInheritEmpty(); if (isset($record[$tableFieldName]['data']) && is_array($record[$tableFieldName]['data'])) { $value = $record[$tableFieldName]['data'][$sheetName]['lDEF'][$fieldName]['vDEF']; $inheritedValue = $this->getInheritedPropertyValueByDottedPath($record, $fieldName); $empty = true === empty($value) && $value !== '0' && $value !== 0; $same = $inheritedValue == $value; if (true === $same && true === $inherit || true === $inheritEmpty && true === $empty) { $removals[] = $fieldName; } } } } } parent::postProcessRecord($operation, $id, $row, $reference, $removals); }
/** * @param string $operation * @param integer $id * @param array $row * @param DataHandler $reference * @return void */ public function postProcessRecord($operation, $id, array &$row, DataHandler $reference) { parent::postProcessRecord($operation, $id, $row, $reference); $parameters = GeneralUtility::_GET(); $this->contentService->affectRecordByRequestParameters($row, $parameters, $reference); }