diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-12 02:17:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-12 02:17:36 +0000 |
commit | 12c2361b2bf7eb15f79bcfa288da8d3a253c07fc (patch) | |
tree | 12e196f2112a4c311af9530722e802b67f1de2a7 | |
parent | 0111b73264cc614e6050b143a42dbdccc8cb974e (diff) | |
download | elgg-12c2361b2bf7eb15f79bcfa288da8d3a253c07fc.tar.gz elgg-12c2361b2bf7eb15f79bcfa288da8d3a253c07fc.tar.bz2 |
Added elgg_list_entities_from_metadata() and deprecated list_entities_from_metadata().
git-svn-id: http://code.elgg.org/elgg/trunk@5372 36083f99-b078-4883-b0ff-0f9b5a30f544
-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 |