Entities and Relations

I have two object type entities - Movie and Director. Both have screens to add data. In the movies add page, I am showing the directors in multiselect box through elgg_get_entities function. While saving, I am creating a relationship entry for movie and director. For example, Jurrassic Park directed by James Cameroon.

Now in the movies listing page, I want to show all the movies along with their respective directors. elgg_list_entities is shwing all the movies in one go. There is a function called elgg_list_entities_from_relationship through which director's information corresponding to each movie can be shown. But how can I club these two functions or iterate through each movie and then can show the respective diretor.

I hope I am clear in explaining my problem.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking