]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #650: Replaced uses of get_metadata_for_entity() by elgg_get_metadata().
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Feb 2011 21:59:10 +0000 (21:59 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Feb 2011 21:59:10 +0000 (21:59 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8177 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php
engine/classes/ElggFile.php
engine/lib/metadata.php
engine/lib/notification.php
views/default/export/entity.php

index cf716b37df03d19f8061b726b81bc51f7f57d703..2adb322de4af24e2d9f826108796efa9232bee40 100644 (file)
@@ -128,7 +128,10 @@ abstract class ElggEntity extends ElggData implements
                        return;
                }
 
-               $metadata_array = get_metadata_for_entity($this->guid);
+               $metadata_array = elgg_get_metadata(array(
+                       'guid' => $this->guid,
+                       'limit' => 0
+               ));
 
                $this->attributes['guid'] = "";
 
@@ -871,7 +874,7 @@ abstract class ElggEntity extends ElggData implements
         *
         * Plugins can register for the 'entity:icon:url', <type> plugin hook
         * to customize the icon for an entity.
-        * 
+        *
         * @param string $size Size of the icon: tiny, small, medium, large
         *
         * @return string The URL
@@ -887,15 +890,15 @@ abstract class ElggEntity extends ElggData implements
 
                $url = "_graphics/icons/default/$size.png";
                $url = elgg_normalize_url($url);
-               
+
                $type = $this->getType();
                $params = array(
                        'entity' => $this,
                        'size' => $size,
                );
-               
+
                $url = elgg_trigger_plugin_hook('entity:icon:url', $type, $params, $url);
-               
+
                return elgg_normalize_url($url);
        }
 
index 2a0d6fb288e24c8c325531d1ea86c86746600915..961a6ef13fdd9d57597dd83d89c985a4ae8e870e 100644 (file)
@@ -315,7 +315,11 @@ class ElggFile extends ElggObject {
 
                // If filestore meta set then retrieve filestore
                // @todo Better way of doing this?
-               $metas = get_metadata_for_entity($this->guid);
+               // ^ Yes....yes there is.
+               $metas = elgg_get_metadata(array(
+                       'guid' => $this->guid,
+                       'limit' => 0
+               ));
                $parameters = array();
                if (is_array($metas)) {
                        foreach ($metas as $meta) {
index c123a89b0ecde277629538510931079ad3e18545..600e72e71e208489d56043f408460380a39db818 100644 (file)
@@ -328,6 +328,12 @@ function delete_metadata($id) {
  *
  * @see elgg_get_entities
  *
+ * @warning 1.7's find_metadata() didn't support limits and returned all metadata.
+ *          This function defaults to a limit of 25. There is probably not a reason
+ *          for you to return all metadata unless you're exporting an entity,
+ *          have other restraints in place, or are doing something horribly
+ *          wrong in your code.
+ *
  * @param array $options Array in format:
  *
  *     metadata_names => NULL|ARR metadata names
index 841920d8b0b4daec3859e4706cdaf0badc1e4dd4..b48fec2fe73766b8646585a8fc90af2bc6059b02 100644 (file)
@@ -173,7 +173,11 @@ function get_user_notification_settings($user_guid = 0) {
                $user_guid = elgg_get_logged_in_user_guid();
        }
 
-       $all_metadata = get_metadata_for_entity($user_guid);
+       // @todo: holy crap, really?
+       $all_metadata = elgg_get_metadata(array(
+               'guid' => $user_guid,
+               'limit' => 0
+       ));
        if ($all_metadata) {
                $prefix = "notification:method:";
                $return = new stdClass;
index faf27e932335ff08ff0d22c620d5145a08e90338..ccee86718cca12f4b73778e4f121e3c0f76b062c 100644 (file)
@@ -11,9 +11,12 @@ $entity = $vars['entity'];
 if (!$entity) {
        throw new InvalidParameterException(elgg_echo('InvalidParameterException:NoEntityFound'));
 }
-
-$metadata = get_metadata_for_entity($entity->guid);
-$annotations = get_annotations($entity->guid);
+$options = array(
+       'guid' => $entity->guid,
+       'limit' => 0
+);
+$metadata = elgg_get_metadata($options);
+$annotations = elgg_get_annotations($options);
 $relationships = get_entity_relationships($entity->guid);
 
 $exportable_values = $entity->getExportableValues();