Hallo,
mit diesem Script (nicht vollständig) möchte ich die Tabelle tt_content synchronieren, die ich mit Mask erweitert habe. Wenn ich jedoch $GLOBALS['TCA']['tt_content'] schreibe tritt ein Fehler auf, was nicht verwunderlich ist, da $GLOBALS['TCA']['ex_content'] schon besetzt ist. Ich habe es nun so gelöst, bin mir aber unsicher ob die Syntax korrekt ist. die Datei tca.php habe ich in den Ordner external_import/configuration/TCA gelegt:
<?php
$GLOBALS['TCA']['ex_content'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tt_content',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY name',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
),
'dynamicConfigFile' => $extensionPath . 'tca.php',
'external' => array(
0 => array(
'connector' => 'csv',
'parameters' => array(
'filename' => $extensionPath . 'Tests\Unit\Utility\testdata.csv',
'delimiter' => ",",
'text_qualifier' => '"',
'skip_rows' => 1,
'encoding' => 'utf-8'
),
'data' => 'array',
'reference_uid' => 'uid',
'priority' => 10,
'description' => 'Import of all company departments'
)
)
),
'interface' => array(
'showRecordFieldList' => 'uid,pid'
),
'feInterface' => $GLOBALS['TCA']['ex_content']['feInterface'],
'columns' => array(
'uid' => array(
'exclude' => 0,
'label' => 'LLL:EXT:external_import/locallang_db.xml:tt_content.uid',
'config' => array(
'type' => 'input',
'size' => '10',
'max' => '4',
'eval' => 'required,trim',
),
'external' => array(
0 => array(
'field' => 'uid'
)
)
),
'pid' => array(
'exclude' => 0,
'label' => 'LLL:EXT:external_import/locallang_db.xml:tt_content.pid',
'config' => array(
'type' => 'input',
'size' => '10',
'max' => '4',
'eval' => 'required,trim',
),
'external' => array(
0 => array(
'field' => 'pid'
)
)
)
)
);
?>