FluidTYPO3\Flux\Provider\AbstractProvider::preProcessRecord PHP Метод

preProcessRecord() публичный Метод

Pre-process record data for the table that this ConfigurationProvider is attached to.
public preProcessRecord ( array &$row, integer $id, TYPO3\CMS\Core\DataHandling\DataHandler $reference ) : void
$row array The record data, by reference. Changing fields' values changes the record's values before display
$id integer The ID of the current record (which is sometimes now included in $row
$reference TYPO3\CMS\Core\DataHandling\DataHandler A reference to the \TYPO3\CMS\Core\DataHandling\DataHandler object that is currently displaying the record
Результат void
    public function preProcessRecord(array &$row, $id, DataHandler $reference)
    {
        $fieldName = $this->getFieldName($row);
        $tableName = $this->getTableName($row);
        if (TRUE === is_array($row[$fieldName]) && TRUE === isset($row[$fieldName]['data']['options']['lDEF']) && TRUE === is_array($row[$fieldName]['data']['options']['lDEF'])) {
            foreach ($row[$fieldName]['data']['options']['lDEF'] as $key => $value) {
                if (0 === strpos($key, $tableName)) {
                    $realKey = array_pop(explode('.', $key));
                    if (TRUE === isset($row[$realKey])) {
                        $row[$realKey] = $value['vDEF'];
                    }
                }
            }
        }
    }