]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1528: Correctly throwing exceptions for objects, groups, and users.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 22 Feb 2010 17:40:42 +0000 (17:40 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 22 Feb 2010 17:40:42 +0000 (17:40 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3968 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/group.php
engine/lib/objects.php
engine/lib/users.php

index a87dbf071713864374a9c92cc6461ca0d79bfcd5..58fd4adabe3bfe74ca691416aa03168597f68ace 100644 (file)
@@ -49,7 +49,7 @@ class ElggGroup extends ElggEntity
                        // Is $guid is an ElggGroup? Use a copy constructor
                        else if ($guid instanceof ElggGroup) {
                                elgg_deprecated_notice('This type of usage of the ElggGroup constructor was deprecated. Please use the clone method.', 1.7);
-                               
+
                                foreach ($guid->attributes as $key => $value) {
                                        $this->attributes[$key] = $value;
                                }
@@ -61,7 +61,7 @@ class ElggGroup extends ElggEntity
                        // We assume if we have got this far, $guid is an int
                        else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
                                }
                        }
 
@@ -747,13 +747,13 @@ function get_entities_from_metadata_groups_multi($group_guid, $meta_array, $enti
  */
 function get_group_members($group_guid, $limit = 10, $offset = 0, $site_guid = 0, $count = false) {
        return elgg_get_entities_from_relationship(array(
-               'relationship' => 'member', 
-               'relationship_guid' => $group_guid, 
-               'inverse_relationship' => TRUE, 
-               'types' => 'user', 
-               'limit' => $limit, 
-               'offset' => $offset, 
-               'count' => $count, 
+               'relationship' => 'member',
+               'relationship_guid' => $group_guid,
+               'inverse_relationship' => TRUE,
+               'types' => 'user',
+               'limit' => $limit,
+               'offset' => $offset,
+               'count' => $count,
                'site_guid' => $site_guid
        ));
 }
index 85ad92a0701781d2c8457e43e2e209be3d51e2f6..6023a4805f004a1e23473f33980a561095c51973 100644 (file)
@@ -55,7 +55,7 @@ class ElggObject extends ElggEntity {
                        // Is $guid is an ElggObject? Use a copy constructor
                        else if ($guid instanceof ElggObject) {
                                elgg_deprecated_notice('This type of usage of the ElggObject constructor was deprecated. Please use the clone method.', 1.7);
-                               
+
                                foreach ($guid->attributes as $key => $value) {
                                        $this->attributes[$key] = $value;
                                }
@@ -69,7 +69,7 @@ class ElggObject extends ElggEntity {
                        // We assume if we have got this far, $guid is an int
                        else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
                                }
                        }
 
@@ -343,8 +343,8 @@ function get_object_sites($object_guid, $limit = 10, $offset = 0) {
        $offset = (int)$offset;
 
        return elgg_get_entities_from_relationship(array(
-               'relationship' => 'member_of_site', 
-               'relationship_guid' => $object_guid, 
+               'relationship' => 'member_of_site',
+               'relationship_guid' => $object_guid,
                'types' => 'site',
                'limit' => $limit,
                'offset' => $offset
index 1d08bd1338eff8b5a1410db9183f319c42dcff6e..549dd35957ad2c1a53db40120e3120bea32eff1a 100644 (file)
@@ -90,7 +90,7 @@ class ElggUser extends ElggEntity
                        // We assume if we have got this far, $guid is an int
                        else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
                                }
                        }