【发布时间】:2014-04-29 09:33:59
【问题描述】:
我有一个后端模块,可以将一些数据从旧的“配置文件”数据库传输到 TYPO3。 对于图像,我首先将它们重命名并将它们放在存储中。 配置文件的记录也已被复制并存储在数据库中。
然后我获取配置文件存储中每个文件的文件信息
$file = $storage->getFile($filetoget['filename']);
给我我需要的东西。
然后我创建一个新的文件引用对象:
$profilemedia = $this->objectManager->get('TYPO3\Regprofiler\Domain\Model\FileReference');
我可以向这个对象添加我需要的所有属性。 我也设置了:
$profilemedia->setUidLocal($fileProps['uid']);
当我将图像添加到我的配置文件并更新我的配置文件存储库时,所有文件引用都按预期存储,除了 uid_local,它保持为 0 有什么烦人的,因为这样我没有得到对 sys_file 的引用,因此:没有图像。
那么我为什么不存储 uid_local 呢?
我的图像 TCA
'image' => array(
'exclude' => 1,
'label' => 'image',
'l10n_mode' => 'mergeIfNotBlank',
'config' => array(
'type' => 'inline',
'foreign_sortby' => 'sorting',
'foreign_table' => 'tx_regprofiler_domain_model_profiler',
'foreign_field' => 'parent',
'size' => 5,
'minitems' => 0,
'maxitems' => 99,
'appearance' => array(
'collapseAll' => 1,
'expandSingle' => 1,
'levelLinksPosition' => 'bottom',
'useSortable' => 1,
'showPossibleLocalizationRecords' => 1,
'showRemovedLocalizationRecords' => 1,
'showAllLocalizationLink' => 1,
'showSynchronizationLink' => 1,
'enabledControls' => array(
'info' => FALSE,
)
)
)
),
【问题讨论】: