diff options
Diffstat (limited to 'lib/models/SimpleORMap.class.php')
| -rw-r--r-- | lib/models/SimpleORMap.class.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/models/SimpleORMap.class.php b/lib/models/SimpleORMap.class.php index 3eeac13..ab2c332 100644 --- a/lib/models/SimpleORMap.class.php +++ b/lib/models/SimpleORMap.class.php @@ -458,7 +458,8 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate */ public static function create($data) { - $record = new static(); + $class = get_called_class(); + $record = new $class(); $record->setData($data, false); if ($record->store()) { return $record; @@ -653,7 +654,8 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate $sql = "WHERE {$sql}"; } - $record = new static(); + $class = get_called_class(); + $record = new $class(); $record->setNew(false); $db_table = static::config('db_table'); |
