【问题标题】:TYPO3 Extbase: Cannot create empty instance of the class ...ObjectStorageTYPO3 Extbase:无法创建类的空实例 ...ObjectStorage
【发布时间】:2016-07-07 02:35:35
【问题描述】:

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,
            ),
        ),
    ),

有什么想法可能是错的吗?

【问题讨论】:

    标签: php typo3 extbase typo3-6.2.x


    【解决方案1】:

    我发现出了什么问题:

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

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

    必须是:

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

    【讨论】:

      猜你喜欢
      • 2013-11-02
      • 2015-11-15
      • 1970-01-01
      • 2020-05-09
      • 1970-01-01
      • 1970-01-01
      • 2011-09-09
      • 1970-01-01
      • 2021-11-28
      相关资源
      最近更新 更多