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
Custom collection support #181
Conversation
Hey @alcaeus. Just wanted to drop a note to say thanks for taking care of this, and also, for keeping the other things like the test changes in tact! 👍 |
@@ -31,6 +31,12 @@ | |||
'hydrator_dir' => 'data/DoctrineMongoODMModule/Hydrator', | |||
'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator', | |||
|
|||
'generate_persistent_collections' => Configuration::AUTOGENERATE_ALWAYS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR, but is it common for other Zend modules to use AUTOGENERATE_ALWAYS
for proxies and hydrators? ODM bundle for instance does the opposite relying on generating proxies/hydrators/collections during cache warmup. Maybe it's something that could be improved for 1.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by, other Zend moduels? This is the Zend module for Doctrine integration. I don't think AUTOGENERATE_NEVER
is a good default since it means your application is broken by default. That's a production default, not a developer default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean other Doctrine-related Zend modules. And I must disagree that app is broken by default, in Symfony's case when cache is not there, it's generated and so are proxies/hydrators because that's hooked into cache-warming process by the bundle so the app is never broken by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not believe ZF has any such thing as a "cache-warming process". One would have to generate Doctrine assets manually, which is not a good default for development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -162,8 +197,8 @@ public function getDriver() | |||
|
|||
/** | |||
* | |||
* @param boolean|int $generateProxies | |||
* @return \DoctrineMongoODMModule\Options\Configuration | |||
* @param boolean $generateProxies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be int
and for BC there could be something like in bundle: https://github.com/doctrine/DoctrineMongoDBBundle/blob/ee1cdebc02d4ed49e90e9ad15737b1be03ac3eee/DependencyInjection/Configuration.php#L54-L58
c308cec
to
ce96953
Compare
Supersedes #166 and #165. I took the liberty of cherry-picking the commits containing the feature and left out larger refactorings (except for
ConfigurationFactoryTest
which makes sense even at this point). I'll be cherry-picking refactorings into a separate PR along with #175.Thanks @Bilge for doing the heavy lifting on this one!