Hello, not sure if this is a support request or feature request.
I have 3 discrete relations of the same relation type set up,
A=>B,
A=>C, and
A=>D.
B, C, and D are each children of A, but are not related to each other.
I need to get the relation ids or the relation objects of the above relations in an array using A's entity id. Is there a function for this?
I see two functions in relation.module,
relation_get_endpoints($relation, $entity_type = NULL),
which seems to get each of the endpoints for only a single relation from the relation object
relation_get_related_entity($entity_type, $entity_id, $relation_type = NULL, $r_index = NULL)
which seems only to be good for getting the first endpoint entity object of the first relation.
Am I missing something? If this doesn't exist, I humbly request a helper function.
Thanks!
Comments
Comment #0.0
ridgek commentedclarification
Comment #1
mikran commentedYes, relation_query() is there for that.
This issue is related, #1288894: Turn relation_get_related_entity into relation_get_related_entities
Comment #2
ridgek commentedAh! I had tried that one unsuccessfully. I must have run it on the wrong parameters. I'll try again. Also looking through the linked issue now. Thanks for your help and quick response! :)
Comment #3
ridgek commentedIt works! Thanks again for your help. Here's the goods!
https://drupal.org/sandbox/ridgekuhn/2099907
Comment #3.0
ridgek commentedcorrection