[TYPO3-mvc] extbase: relations simple question

Dmitri Pusarev dimaip at gmail.com
Thu Feb 18 11:58:00 CET 2010


Thanks for your reply Jochen!
Jochen Rau wrote:
> 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. 
Where does it add it to? I have created a relation from Client to 
Project, zero to many foreign field, and called it projects.
Then I saved, and opened the Project model file, and there is no Client 
property defined. Is it some kind of magic property that it does not 
have to be in the model file? Really I don't get it:(
> 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.
Where can I read more about @lazy and other things? I've just read the 
docs for extbase from svn.
> 
> Regards
> Jochen


More information about the TYPO3-project-typo3v4mvc mailing list