FluidTYPO3\Flux\Service\ContentService::createMappingArray PHP Method

createMappingArray() protected method

protected createMappingArray ( string $command, string $subCommand, integer $id, array $row, TYPO3\CMS\Core\DataHandling\DataHandler $tceMain ) : array
$command string
$subCommand string
$id integer
$row array
$tceMain TYPO3\CMS\Core\DataHandling\DataHandler
return array
    protected function createMappingArray($command, $subCommand, $id, array $row, DataHandler $tceMain)
    {
        $mappingArray = array();
        if ('copy' !== $command) {
            $mappingArray[$id] = $row;
        } else {
            // Only override values from content elements in cmdmap to prevent that child elements "inherits"
            // tx_flux_parent and tx_flux_column which would position them outside their tx_flux_parent.
            foreach ($tceMain->cmdmap['tt_content'] as $copyFromUid => $cmdMapValues) {
                $copyToUid = $tceMain->copyMappingArray['tt_content'][$copyFromUid];
                $record = $this->loadRecordFromDatabase($copyToUid);
                if ('reference' === $subCommand) {
                    $record['CType'] = 'shortcut';
                    $record['records'] = $id;
                }
                $mappingArray[$copyFromUid] = $record;
            }
        }
        return $mappingArray;
    }