zenstruck / foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.
https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html
MIT License
609 stars 63 forks source link

[Foundry 2] Allow objects creation in data provider #532

Open nikophil opened 7 months ago

nikophil commented 7 months ago

Maybe we could use lazyness behavior of the proxy system and delay persistence when the object is accessed

kbond commented 6 months ago

Yes, we should at least experiment with this before releasing 2.0 to ensure it's possible w/o a BC break.

nikophil commented 6 months ago

cool! I'm just wondering if in any way, we could add a ->proxy() method to the PersistenceObjectFactory... because it will be one of the only usecase, I'd reallyl need proxies