We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5efc30 commit 652ef4bCopy full SHA for 652ef4b
src/Jenssegers/Mongodb/Relations/EmbedsMany.php
@@ -162,7 +162,7 @@ public function save(Model $model)
162
protected function performInsert(Model $model)
163
{
164
// Create a new key.
165
- if ( ! isset($model['_id']) or empty($model['_id']))
+ if ( ! $model->getAttribute('_id'))
166
167
$model->setAttribute('_id', new MongoId);
168
}
0 commit comments