You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we're using "force" here to avoid a potential type check in a setter
316
+
$value->create([$inverseField => force(null)]),
317
+
withAutoRefresh: false
318
+
);
310
319
311
-
$this->tempAfterInstantiate[] = staticfunction(object$object) use ($inversedObject, $inverseField, $pm, $placeholder) {
312
-
$pm->forget($placeholder);
313
-
set($inversedObject, $inverseField, $object);
314
-
};
320
+
$this->tempAfterInstantiate[] = staticfunction(object$object) use ($inverseObject, $inverseField) {
321
+
set($inverseObject, $inverseField, $object);
322
+
};
315
323
316
-
return$inversedObject;
324
+
return$inverseObject;
325
+
} else {
326
+
thrownew \InvalidArgumentException('Cannot handle inverse OneToOne relationship because both side are not nullable, which will result in a circular dependency.');
327
+
}
317
328
}
318
329
}
319
330
@@ -352,7 +363,7 @@ protected function normalizeCollection(string $field, FactoryCollection $collect
352
363
set($object, $field, $inverseObjects);
353
364
};
354
365
355
-
// creation delegated to afterPersist hook - return empty array here
366
+
// creation delegated to tempAfterInstantiate hook - return empty array here
0 commit comments