Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Cursor should be reset and limit should be restored after calling getSingleResult #68

Merged
merged 1 commit into from Sep 9, 2012
Merged

Cursor should be reset and limit should be restored after calling getSingleResult #68

merged 1 commit into from Sep 9, 2012

Conversation

Parad0X
Copy link
Contributor

@Parad0X Parad0X commented Aug 13, 2012

Currently calling getSingleResult leaves cursor in a weird state.
I think the following scenario makes sense

<?php

$document = $cursor->getSingleResult();
echo 'Newest document in this collection was created: ' . date('c', $document['created_at']->sec);

foreach ($cursor as $document) {
    // do something with a document
}

Currently if I try iterating over a cursor after calling getSingleResult I'm only going to get the second document in that cursor.

@travisbot
Copy link

This pull request passes (merged e68e6df3 into fdf44d8).

@travisbot
Copy link

This pull request passes (merged 80501e47 into fdf44d8).

@travisbot
Copy link

This pull request passes (merged 5fb41c6 into fdf44d8).

jwage added a commit that referenced this pull request Sep 9, 2012
Cursor should be reset and limit should be restored after calling getSingleResult
@jwage jwage merged commit b5ab03b into doctrine:master Sep 9, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants