Skip to content

Commit

Permalink
"id" is not always the name of the primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
fastzen committed Jun 1, 2016
1 parent 4e9a24f commit 887e226
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/models/mvc_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ protected function process_objects($objects, $options=array()) {
$object = $this->new_object($array);
}

if ( (!empty($this->primary_key)) && (!empty($object->id)) ) {
if ( (!empty($this->primary_key)) && (!empty($object->{$this->primary_key})) ) {
$object->__id = $object->{$this->primary_key};
}

Expand Down

0 comments on commit 887e226

Please sign in to comment.