From d0cee489037f5f3c1272458a7d28833774545ffe Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 13 Mar 2008 16:34:18 +0000 Subject: Marcus Povey * Fixed insert SQL git-svn-id: https://code.elgg.org/elgg/trunk@206 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index e5fe74b7f..83d04391f 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -42,8 +42,8 @@ $this->attributes['subtype'] = ""; $this->attributes['owner_guid'] = 0; $this->attributes['access_id'] = 0; - $this->attributes['time_created'] = time(); - $this->attributes['time_updated'] = time(); + $this->attributes['time_created'] = ""; + $this->attributes['time_updated'] = ""; } /** @@ -302,7 +302,7 @@ if ($result) return $result->id; - return false; + return 0; } /** @@ -365,11 +365,8 @@ $owner_guid = (int)$owner_guid; $access_id = (int)$access_id; $time = time(); - - if (!$subtype) - throw new InvalidParameterException("Entity subtype '$subtype' is not supported"); - - return insert_data("INSERT into {$CONFIG->dbprefix}entities (type,subtype,owner_guid,access_id,time_created,time_updated) values ('$type',$subtype, $owner_guid, $access_id, $time, $time)"); + + return insert_data("INSERT into {$CONFIG->dbprefix}entities (type, subtype, owner_guid, access_id, time_created, time_updated) values ('$type',$subtype, $owner_guid, $access_id, $time, $time)"); } /** -- cgit v1.2.3