diff options
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/metadata.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 1795116c0..2b5ace7a7 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -912,6 +912,7 @@ $count = FALSE, $case_sensitive = TRUE) { * * @see elgg_view_entity_list * + * @deprecated 1.7 Use elgg_list_entities_from_metadata * @param mixed $meta_name Metadata name to search on * @param mixed $meta_value The value to match, optionally * @param string $entity_type The type of entity to look for, eg 'site' or 'object' @@ -924,6 +925,8 @@ $count = FALSE, $case_sensitive = TRUE) { * @return string A list of entities suitable for display */ function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type = ELGG_ENTITIES_ANY_VALUE, $entity_subtype = ELGG_ENTITIES_ANY_VALUE, $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true, $case_sensitive = true ) { + elgg_deprecated_notice('get_entities_from_metadata_multi() was deprecated by elgg_get_entities_from_metadata()!', 1.8); + $offset = (int) get_input('offset'); $limit = (int) $limit; $options = array( @@ -946,6 +949,30 @@ function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type } /** + * Returns a list of entities filtered by provided metadata. + * + * @see elgg_get_entities_from_metadata + * + * @param array $options + */ +function elgg_list_entities_from_metadata($options) { + $defaults = array( + 'offset' => 0, + 'limit' => 10, + 'full_view' => TRUE, + 'view_type_toggle' => FALSE, + 'pagination' => TRUE + ); + + $options = array_merge($defaults, $options); + + $count = elgg_get_entities_from_metadata(array_merge(array('count' => TRUE), $options)); + $entities = elgg_get_entities_from_metadata($options); + + return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination); +} + +/** * @deprecated 1.7. Use elgg_get_entities_from_metadata(). * @param $meta_array * @param $entity_type |