TYPO3 Extbase:无法创建类的空实例... ObjectStorage

时间:2016-03-20 16:48:41

标签: php typo3 extbase typo3-6.2.x

extbase extension creation

期间,我的项目出现以下TYPO3错误
Cannot create empty instance of the class
"TYPO3\CMS\Extbase\Persistence\ObjectStorage" because it does not implement
the TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface.

我认为这与从另一个扩展程序rezepte加载对象有关。

'rezepte' => array(
        'exclude' => 0,
        'label' => 'LLL:EXT:nebenwirkungen/Resources/Private/Language/locallang_db.xlf:tx_nebenwirkungen_domain_model_nebenwirkung.rezepte',
        'config' => array(
            'type' => 'select',
            'foreign_table' => 'tx_rezepte_domain_model_rezept',
                            'foreign_table_where' => 'AND tx_rezepte_domain_model_rezept.sys_language_uid=###REC_FIELD_sys_language_uid### ORDER BY tx_rezepte_domain_model_rezept.rezeptname',
            'MM' => 'tx_nebenwirkungen_nebenwirkung__mm',
            'size' => 10,
            'autoSizeMax' => 30,
            'maxitems' => 9999,
            'multiple' => 0,
            'wizards' => array(
                '_PADDING' => 1,
                '_VERTICAL' => 1,
            ),
        ),
    ),

任何想法可能出错?

1 个答案:

答案 0 :(得分:3)

我发现了什么问题:

我忘了在模型文件中设置对象存储的类型:

\TYPO3\CMS\Extbase\Persistence\ObjectStorage<>

必须是:

\TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EmP\Rezepte\Domain\Model\Rezept>