Skip to content

Commit 8fefc9a

Browse files
committed
Merge pull request fzaninotto#677 from davidyell/patch-1
CakePHP ORM: Fix primaryKey warning
2 parents 7bb840f + e7acaa7 commit 8fefc9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Faker/ORM/CakePHP/EntityPopulator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ public function execute($class, $insertedEntities, $options = [])
130130
}
131131

132132
$pk = $table->primaryKey();
133-
return $entity->{$pk};
133+
if (is_string($pk)) {
134+
return $entity->{$pk};
135+
}
136+
137+
return $entity->{$pk[0]};
134138
}
135139

136140
public function setConnection($name)

0 commit comments

Comments
 (0)