Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
07b09321
Commit
07b09321
authored
Jul 29, 2013
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use iterator_to_array second parameter instead of array_values
parent
f1ee99ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
Builder.php
src/Jenssegers/Mongodb/Builder.php
+1
-1
QueryTest.php
tests/QueryTest.php
+1
-0
No files found.
src/Jenssegers/Mongodb/Builder.php
View file @
07b09321
...
@@ -153,7 +153,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
...
@@ -153,7 +153,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
if
(
$this
->
limit
)
$cursor
->
limit
(
$this
->
limit
);
if
(
$this
->
limit
)
$cursor
->
limit
(
$this
->
limit
);
// Return results
// Return results
return
array_values
(
iterator_to_array
(
$cursor
)
);
return
iterator_to_array
(
$cursor
,
false
);
}
}
}
}
...
...
tests/QueryTest.php
View file @
07b09321
...
@@ -64,6 +64,7 @@ class QueryTest extends PHPUnit_Framework_TestCase {
...
@@ -64,6 +64,7 @@ class QueryTest extends PHPUnit_Framework_TestCase {
$users
=
DB
::
collection
(
'users'
)
->
where
(
'address.country'
,
'Belgium'
)
->
get
();
$users
=
DB
::
collection
(
'users'
)
->
where
(
'address.country'
,
'Belgium'
)
->
get
();
$this
->
assertEquals
(
1
,
count
(
$users
));
$this
->
assertEquals
(
1
,
count
(
$users
));
$this
->
assertEquals
(
'John Doe'
,
$users
[
0
][
'name'
]);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment