Plugins Shopware 6为自定义实体创建数据库条目

Plugins Shopware 6为自定义实体创建数据库条目,plugins,shopware,Plugins,Shopware,我正试图按照BundleExample&Storefinder的思路为Shopware6构建一个插件,但我一直在为我的实体创建相应的条目。我在管理员中添加了一个模块,它有3个组件:列表、详细信息和创建 路由到[供应商名称].[插件名称].list/.detail/.create 来自custom\plugins[plugin name]\src\Resources\administration\module[vendor name]-[plugin name]\index.js rout

我正试图按照BundleExample&Storefinder的思路为Shopware6构建一个插件,但我一直在为我的实体创建相应的条目。我在管理员中添加了一个模块,它有3个组件:列表、详细信息和创建 路由到[供应商名称].[插件名称].list/.detail/.create

来自custom\plugins[plugin name]\src\Resources\administration\module[vendor name]-[plugin name]\index.js

    routes:{
        list:{
            component: '[vendor-name]-[plugin-name]-list',
            path: 'list'
        },
        detail:{
            component: '[vendor-name]-[plugin-name]-detail',
            path: 'detail/:id',
            meta:{
                parentPath: '[vendor-name].[plugin-name].list'
            }
        },
        create:{
            component: '[vendor-name]-[plugin-name]-create',
            path: 'create',
            meta:{
                parentPath: '[vendor-name].[plugin-name].list'
            }
        }
/当数据库中没有条目时,列表将按预期显示,这意味着只有smartbar可见。 /细节无法工作,因为还没有实体,所以没有id。 /create应该通过生成一个实例

created(){
   this.repository = this.repositoryFactory.create('[vendor-name]_[plugin-name]');
   this.repository.create(this.context);
}
但什么都没有发生

我肯定我忽略了某个地方的一个基本步骤,如果有任何关于如何让它实际生成一个条目的提示,我将不胜感激。
如果进一步的代码有助于澄清这个问题,我将很乐意提供它。

代码>this.repository.create(this.context)行将在客户端创建自定义实体的实体对象。 要保存该实体,必须调用
this.repository.save(entity,this.context)。
然后,您应该能够在浏览器的开发控制台中看到发送到服务器的请求

有关更多信息,请查看


请记住
this.repository.create(this.context)创建一个空的虚拟实体,因此您至少需要设置自定义实体的所有必填字段。

非常感谢。我仍在摸索方向,还没有找到那部分文档。我假设它会生成一个空的shell,其中只有一个Id,我可以通过在后端填充的按钮来填充和保存。