Skip to content
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

[5.2] Allows developers to traverse their query result via a cursor #13030

Merged
merged 9 commits into from
May 24, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
StyleCI fixes
  • Loading branch information
Khary Sharpe committed Apr 6, 2016
commit dea6794dd321449dc98849627bdccf26074e181f
7 changes: 2 additions & 5 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,15 @@ public function firstOrFail($columns = ['*'])

/**
* Traverses through a result set using a cursor.
*
* @return void
*
* @return void
*/
public function traverse()
{
$builder = $this->applyScopes();

$statement = $builder->query->fetch();


while ($row = $statement->fetch()) {
// On each result set, we will pass them to the callback and then let the
// developer take care of everything within the callback, which allows us to
Expand All @@ -312,9 +311,7 @@ public function traverse()
if ($continue === false) {
return;
}

}

}

/**
Expand Down