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?
What I want to do:
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
Note: As stated in other question creating relations between tables/models doesn't require adding foreign keys
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)
Creating relation to
FrontendUser
model /fe_user
tableIn TYPO3 ver. 6.2
fe_user
has a model as well:\TYPO3\CMS\Extbase\Domain\Model\FrontendUser
, you can just add this as common relation in Builder modeling tool (fig. 2 at screenshot) in the field\Fully\Qualified\Classname
(you need toShow advanced fields
to set it (fig. 1) use thisFrontendUser
and it will create properSQL
andTCA
definitions.Real extending
FrontendUser
(FU) modelOn the other hand if your
People
* model just extends thefe_user
table, because you want to reuse existing fe_user table for your people, you can also extendFrontendUser
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.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 likeTx_YourExt_Employee
*
note: For model names you should use singular form i.eMan
instead ofPeople