Hi,
I was wondering if there is a built-in function, that for any entity (in my case, users) it will return all possible values of an individual piece of metadata. I couldn't see anything appropriate in http://reference.elgg.org/engine_2lib_2metadata_8php.html
For example, all current values stored for the metadata named 'company' for the entity 'user'.
Or is the simplest way just looping through an array of all current users entity objects, inserting the particular company value into an array of results?
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.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- stevewc@stevewc
stevewc - 0 likes
- Cash@costelloc
Cash - 0 likes
- stevewc@stevewc
stevewc - 0 likes
- Cash@costelloc
Cash - 0 likes
You must log in to post replies.Try OpenDD
Thanks - but it's not really data export I'm after. I'm writing a plugin that needs to process & display all the 'companies' that users work for (companies being a custom metadata field I've added to users).
I could look through an array of all user entities and pull out this field's value for all entities but I was wondering if there is such a function built in?
You could use the elgg_get_tags() function.
Thanks - that looks perfect. I wasn't planning on using that metadata field as a tag but I don't think it'll hurt. Cheers
You don't need to use it as a tag everywhere on the site. As an example, take a look at how the file plugin uses the type of the file to create a categorized list: get_filetype_cloud() in http://trac.elgg.org/browser/elgg/branches/1.7/mod/file/start.php
It registers that metadata name as a tag just for that call.