简体   繁体   English

Typo3 v10 持久性映射foreignClass

[英]Typo3 v10 Persistence Mapping foreignClass

since Typo3 v10 you have to use Classes.php file in Configuration/extbase/Persistence Folder for configuration of persistence table mapping.从 Typo3 v10 开始,您必须使用 Configuration/extbase/Persistence 文件夹中的 Classes.php 文件来配置持久性表映射。

Does anyone know how to implement有谁知道如何实施

config.tx_extbase.persistence.classes {

    Domain\DomainUsergroupMailer\Domain\Model\FrontendUserGroups { 
    mapping {
        tableName = fe_groups
        columns {
            subgroup.foreignClass = TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup
        }
    } 
}

I can't find documentation concerning the foreignClass Parameter.我找不到有关 foreignClass 参数的文档。 I found parameter subclasses in https://docs.typo3.org/m/typo3/book-extbasefluid/10.4/en-us/6-Persistence/5-modeling-the-class-hierarchy.html我在https://docs.typo3.org/m/typo3/book-extbasefluid/10.4/en-us/6-Persistence/5-modeling-the-class-hierarchy.html中找到了参数子类

Does anyone know if this is the right way parameter and how to use it?有谁知道这是否是正确的方式参数以及如何使用它?

Thank you谢谢

There never was such a feature in TYPO3 as confirmed by searching the TYPO3v9 source code for foreignClass .通过在 TYPO3v9 源代码中搜索foreignClass来确认 TYPO3 中从来没有这样的功能。 So this must be provided by a 3rd party extension.所以这必须由第 3 方扩展提供。

However, from the name it sounds like you only need to use an appropriate element type for your collection relation:但是,从名称看来,您只需要为您的集合关系使用适当的元素类型:

/**
 * @var ObjectStorage<FrontendUserGroup>
 */
private ObjectStorage $subgroup;

See Implementing the domain model for details.有关详细信息,请参阅实现域模型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM