Skip to content

Commit

Permalink
Update src/Jenssegers/Mongodb/Relations/EmbedsMany.php
Browse files Browse the repository at this point in the history
Co-Authored-By: Jens Segers <segers.jens@gmail.com>
  • Loading branch information
mnphpexpert and jenssegers committed Sep 11, 2019
1 parent 1ed9685 commit c074e2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Jenssegers/Mongodb/Relations/EmbedsMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function attach(Model $model)
protected function associateNew($model)
{
// Create a new key if needed.
if ($model->getKeyName() == '_id' && !$model->getAttribute('_id')) {
if ($model->getKeyName() === '_id' && !$model->getAttribute('_id')) {
$model->setAttribute('_id', new ObjectID);
}

Expand Down

0 comments on commit c074e2b

Please sign in to comment.