-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Add implementation of Countable for CachingIterator #2450
Conversation
@Branlute thanks for the PR! Could you please add a test to https://github.com/doctrine/mongodb-odm/blob/2.4.x/tests/Doctrine/ODM/MongoDB/Tests/Functional/Iterator/CachingIteratorTest.php so the ability to call
🍻 |
5224b08
to
b9edc5e
Compare
b9edc5e
to
36c3767
Compare
@Branlute thanks for the updates! We'll need to take care of CI first before merging as something is really off with it. I'll merge this whenever I'll have a chance :) |
@Branlute we've managed to get checks back to shape (sorry for the long time wait :( ). May I ask you to rebase your PR atop newly created |
36c3767
to
3f22c10
Compare
@malarzm I rebase my branch with 2.5.x and change the target branch to 2.5.x |
3f22c10
to
d2fc01c
Compare
Thanks @Branlute! 🚀 |
Summary
Hi,
I currently use MongoDB with Doctrine, as well as ElasticSearch through FOSElascitaBundle.
When trying to use EnqueueBundle to speed up the populate command https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/doc/cookbook/speed-up-populate-command.md, I encountered an error.
The enqueue command for elastica makes a count of getCurrentPageResults:
https://github.com/php-enqueue/enqueue-elastica-bundle/blob/master/Queue/PopulateProcessor.php#L61
Unfortunately, Doctrine's CachingIterator does not implement countable unlike Mongo's https://github.com/mongodb/mongo-php-library/blob/master/src/Model/CachingIterator.php which generates an error.
So I added the implementation of countable in CachingIterator in order to be able to use Enqueue with FOSElastica and MongoDB via Doctrine.
Thank you very much for the library 😉