I'm developing a plugin that creates two types of entities: Projects and Roles. Roles belong to projects, so when a Project is deleted all its Roles should be deleted as well. Is there a well-established way in Elgg to maintain this relationship and to delete a Role when its Project is deleted? I can figure out how to do it manually, but I want to do it right, in a way that's less error prone (i.e., one where a mistake won't leave garbage data lying around, as is currently the case), and more in line with community standards. Thanks in advance!
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.
- Dylan_MFS@dylan_mfs
Dylan_MFS - 0 likes
- Evan Winslow@ewinslow
Evan Winslow - 0 likes
You must log in to post replies.For anyone who reads this in the future, I didn't receive a response so I performed deletion manually when a Project was deleted. Specifically, I maintained a field in each Project called 'roles' containing the GUID of each Role associated with the Project. When a Project is deleted, logic akin to the following occurs:
I hope that helps anyone who reads this!
The Right Way to do this is probably to set each role's container_guid to the associated project's guid. Deleting a container recursively deletes all contained entities as well.