Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit b1313b7

Browse files
authored
Merge pull request #121 from ElliottLandsborough/patch-1
Fix getKey check when ($model['id'] === 0)
2 parents 6214ac2 + fef3820 commit b1313b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Payloads/DocumentPayload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DocumentPayload extends TypePayload
1313
*/
1414
public function __construct(Model $model)
1515
{
16-
if (!$model->getKey()) {
16+
if ($model->getKey() === null) {
1717
throw new Exception(sprintf(
1818
'The key value must be set to construct a payload for the %s instance.',
1919
get_class($model)
@@ -25,4 +25,4 @@ public function __construct(Model $model)
2525
$this->payload['id'] = $model->getKey();
2626
$this->protectedKeys[] = 'id';
2727
}
28-
}
28+
}

0 commit comments

Comments
 (0)