by now, I use a maybe stupid way:
First, I have a parent_id.
1. save the entity ,
2. and then pick out the guid of this newest entity,
3. and then make relationship with the parent_id.
Is there a better way to do this?
Thanks.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- jdleung@jdleung
jdleung - 0 likes
- Brett@brett.profitt
Brett - 0 likes
- jdleung@jdleung
jdleung - 0 likes
You must log in to post replies.Is there a function that can do the things at the same time?
This is a pretty common code flow so I don't think you're doing it incorrectly. There is no function that creates and entity and assigns a relationship at the same time.
I'm a newbie, so I doubt myself ;-)
Thanks.