Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #677 from davidyell/patch-1
Browse files Browse the repository at this point in the history
CakePHP ORM: Fix primaryKey warning
  • Loading branch information
fzaninotto committed Aug 26, 2015
2 parents 7bb840f + e7acaa7 commit 8fefc9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Faker/ORM/CakePHP/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ public function execute($class, $insertedEntities, $options = [])
}

$pk = $table->primaryKey();
return $entity->{$pk};
if (is_string($pk)) {
return $entity->{$pk};
}

return $entity->{$pk[0]};
}

public function setConnection($name)
Expand Down

0 comments on commit 8fefc9a

Please sign in to comment.