From ecd6f2180a5c2d846e15d2205f696f52bce9a575 Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 3 Apr 2008 10:16:19 +0000 Subject: Marcus Povey * Exception thrown if load fails git-svn-id: https://code.elgg.org/elgg/trunk@389 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/objects.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engine/lib/objects.php') 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; } -- cgit v1.2.3