[TYPO3-mvc] extbase: relations simple question
Jochen Rau
jochen.rau at typoplanet.de
Thu Feb 18 09:45:03 CET 2010
Hi Dmitry.
On 17.02.10 20:15, Dmitri Pusarev wrote:
> I looked up the blog_example, and there a relation between Blog and Post
> is defined both ways. So if I do the same in kickstarter it would look
> ugly having two wires for pair of objects.
If you have defined your relation Client<->Project to use a foreign key
you only have to apply one wire. The Kickstarter will add a property
"client" to your Project automatically and "fills" it with the related
Client. The foreign key field "client" holds the uid of the client. As
the property "client" is annotated with the class name, Extbase tries to
translate the uid in the appropriate Client object.
In your Client there will be a property "project" holding all related
Project objects as expected.
Be aware of circular dependencies (building a Project->building related
Client->building Projects->building Client .....). Try to add @lazy to
the "client" property if necessary.
Regards
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list