aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/objects.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-03 10:16:19 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-03 10:16:19 +0000
commitecd6f2180a5c2d846e15d2205f696f52bce9a575 (patch)
tree1470a4e3eb2fb7f2cce08f516260f73d839359e6 /engine/lib/objects.php
parentd599fe0cfb93bad66a194ffd11e44a97867c0fa0 (diff)
downloadelgg-ecd6f2180a5c2d846e15d2205f696f52bce9a575.tar.gz
elgg-ecd6f2180a5c2d846e15d2205f696f52bce9a575.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Exception thrown if load fails git-svn-id: https://code.elgg.org/elgg/trunk@389 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/objects.php')
-rw-r--r--engine/lib/objects.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 0a8dffc65..ff8ebd558 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -44,14 +44,15 @@
*/
function __construct($guid = null)
{
- $this->initialise_attributes();
+ $this->initialise_attributes();
if (!empty($guid))
{
// Is $guid is a DB row - either a entity row, or a object table row.
if ($guid instanceof stdClass) {
// Load the rest
- $this->load($guid->guid);
+ if (!$this->load($guid->guid))
+ throw new IOException("Failed to load new ElggObject from GUID:$guid->guid");
}
// Is $guid is an ElggObject? Use a copy constructor
@@ -100,7 +101,7 @@
$objarray = (array) $row;
foreach($objarray as $key => $value)
$this->attributes[$key] = $value;
-
+
return true;
}