TYPO3 前端用户的外键 [英] Foreign Key to TYPO3 Frontend User

查看:21
本文介绍了TYPO3 前端用户的外键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Extension Builder 中为 TYPO3 FrontendUsers 设置 ForeignKey?

How can I set a ForeignKey to the TYPO3 FrontendUsers in the Extension Builder?

我必须将参数映射设置为现有表吗?还是建立关系?

Do I have to set the param map to existing table? oder make a relation?

我想做什么:

我有一个模型(人),它有自己的字段和值.现在我想在这个模型和 TYPO3 FE 用户之间建立一个新的关系

I've got a Model (People) with its own fields and values. and now I want to have a new Releation between this Model and the TYPO3 FE Users

PeopleNr = fe_user with uid 123

PeopleNr = fe_user with uid 123

推荐答案

注意: 其他问题在表/模型之间创建关系不需要添加外键

Note: As stated in other question creating relations between tables/models doesn't require adding foreign keys

我不太确定您需要它来做什么,但这里描述了两种最常见的情况(屏幕截图显示了如何使用 Extension Builder 实现每种情况)

I'm not quite sure what do you need it for, but here's description of two most common cases (screenshot shows how to achieve each case with Extension Builder)

在 TYPO3 版本中.6.2 fe_user 也有一个模型:TYPO3CMSExtbaseDomainModelFrontendUser,你可以在 Builder 建模工具中添加这个作为公共关系(fig. 2 at screenshot)在 FullyQualifiedClassname 字段中(您需要 Show advanced fields 来设置它(fig. 2).1) 使用这个 FrontendUser,它会创建正确的 SQLTCA 定义.

In TYPO3 ver. 6.2 fe_user has a model as well: TYPO3CMSExtbaseDomainModelFrontendUser, you can just add this as common relation in Builder modeling tool (fig. 2 at screenshot) in the field FullyQualifiedClassname (you need to Show advanced fields to set it (fig. 1) use this FrontendUser and it will create proper SQL and TCA definitions.

另一方面,如果您的 People* 模型只是扩展了 fe_user 表,因为您想为您的人员重用现有的 fe_user 表,您也可以 为真实扩展 FrontendUser 模型(图 3),在这种情况下,您将继承来自 FU 等的所有 getter、setter,并且您不需要自己写.

On the other hand if your People* model just extends the fe_user table, because you want to reuse existing fe_user table for your people, you can also extend FrontendUser model for real (fig. 3) in that case you'll inherit all getters, setters from FU etc. and you won't need to write them yourself.

在这种情况下,您的模型将是 fe_user 的单独类型,鉴别器字段默认为:tx_extbase_type 并且构建器将添加新类型,例如 Tx_YourExt_Employee

In such case your model will be a separate type of fe_user, the discriminator field is by default: tx_extbase_type and builder will add new type like Tx_YourExt_Employee

* 注意:对于模型名称,您应该使用单数形式,即 Man 而不是 People

* note: For model names you should use singular form i.e Man instead of People

这篇关于TYPO3 前端用户的外键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆