Permalink
Browse files

fixed PK error when setting the PK manually. Closes #184

  • Loading branch information...
WanWizard committed Sep 20, 2012
1 parent 42a37ce commit cf4c397ec71ba6e5fcd05b8b91328dd46eed734d
Showing with 2 additions and 1 deletion.
  1. +2 −1 classes/model.php
View
@@ -1083,7 +1083,8 @@ protected function create()
if (count($primary_key) == 1 and $id !== false)
{
$pk = reset($primary_key);
$this->{$pk} = $id;
// only set it if it hasn't been set manually
is_null($this->{$pk}) and $this->{$pk} = $id;
}
// update the original properties on creation and cache object for future retrieval in this request

0 comments on commit cf4c397

Please sign in to comment.