-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.0] Problem with inversed OneToOne
relationships
#655
Comments
simondaigre
changed the title
[2.0] Can't use Reusable Factory "States" (->with()) in
[2.0] Can't use Reusable Factory "States" (Jun 27, 2024
defaults()
method->with()
) in defaults()
method
Hi @simondaigre
nice to hear that! 😊 You problem definitively sounds like a bug. I'm trying to reproduce it. |
hmm I kinda made the same thing, but everything is hydrated as expected 🤔 // Object1Factory
protected function defaults(): array|callable
{
return [
'object2' => Object2Factory::new()->withSomeObject(),
];
}
// Object2Factory
public function withSomeObject(): static
{
return $this->with(static fn (): array => ['object3' => Object3Factory::new(['prop1' => 'toto'])]);
} any chance you create a public reproducer please? |
ok, I confirm that there is a bug: |
nikophil
changed the title
[2.0] Can't use Reusable Factory "States" (
[2.0] Problem with inversed Jun 28, 2024
->with()
) in defaults()
methodOneToOne
relationships
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there,
I'm upgrading a project from 1.38 to 2.0. With the Rector rule, the upgrade is really smooth, thanks @nikophil !
I just have a minor issue, in one Factory, in the
defaults()
method, I'm doing something like this :And in Customer factory :
With Foundry 1.38, my Customer was containing an User, since 2.0 User is always null.
Is it something deprecated or a bug ?
The text was updated successfully, but these errors were encountered: