2.0 Ideas
@wouterj and I have been discussing some potential changes for 2.0. This is a list of potential ideas:
- [x] #37
- [ ] Rename
ProxyRepositorytoRepositoryDecoratorand mark internal ("proxy" is a bit of a misnomer - it is actually a "decorator") - [ ] Remove
Proxyand changeFactory::create()to return the real doctrine entity. While the proxy idea is clever and sort of creates a "quasi" AR system for your entities, it can be confusing (to use and document) - [ ] Move the AR helpers (save, refresh, delete) to the
ModelFactory/RepositoryDecoratorand some stand alone helper functions - [ ] Investigate if
ocramius/proxy-managercould be used for auto-refresh as this would be lost with removal of theProxy - [x] Method names:
$user = UserFactory::new()->create()->object()is unfortunate. The->object()would be removed by removing theProxy(above) but$user = UserFactory::new()->create()is still confusing... (solved in #111) - [x] #113
- [ ]
ModelFactory::repository()/AnonymousFactory::repository()to return the "real" repository for the entity - [x] #126
- [x] Move reset env variables to config options (
FOUNDRY_DISABLE_DATABASE_RESET,FOUNDRY_RESET_CONNECTIONS,FOUNDRY_RESET_OBJECT_MANAGERS)? https://github.com/zenstruck/foundry/pull/320 - [x] Remove bundless usage. This is a vestigial feature that likely only I'm using (with no reason I can't switch to using the bundle). I believe only allowing bundle config would drastically reduce complexity. https://github.com/zenstruck/foundry/issues/319
- [ ] [BC BREAK] make
ModelFactory::getClass()public and removeModelFactory::getEntityClass()? See #162 for details (specifically https://github.com/zenstruck/foundry/pull/162#discussion_r632956940) - [x] ODM Support (or at least make adding support for this easier)
Method names: $user = UserFactory::new()->create()->object() is unfortunate. The ->object() would be removed by removing the Proxy (above) but $user = UserFactory::new()->create() is still confusing...
See #111 for a proposal to fix this
Hello @kbond sorry if it's not the correct place to ask kind of things
Are you willing to supportdoctrine/odm in the future version this library?
@nikophil the library is written based on doctrine/persistence (with some specific features requiring doctrine/orm). So there is a theoretical chance that this bundle supports doctrine/odm already (but afaik, it has never been tested).
Nice to here that, I'm gonna try that on a project of mine which uses mongo I'm afraid it won't support embedded collections out of the box... I'll let you know