From 8a46f5d6305a6f47a87f3bf179e4a9bb632a5dac Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 10 Jul 2012 12:05:04 +0200 Subject: [PATCH] Make database insertion play nice with autoloading. --- class.databaserecord.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/class.databaserecord.php b/class.databaserecord.php index bf78673..b76a523 100644 --- a/class.databaserecord.php +++ b/class.databaserecord.php @@ -419,8 +419,11 @@ abstract class CPHPDatabaseRecordClass extends CPHPBaseClass } else { - $classname = get_class($this); - throw new Exception("Database insertion failed: prototype property {$value['key']} not found in object of type {$classname}."); + if($this->autoloading === false) + { + $classname = get_class($this); + throw new Exception("Database insertion failed: prototype property {$value['key']} not found in object of type {$classname}."); + } } }