Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
36b27d72
Commit
36b27d72
authored
Dec 22, 2014
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'shieldo-remove_document_check' into develop (PR #296)
parents
a9d8a52b
3d2e8828
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
library/Solarium/QueryType/Update/Query/Command/Add.php
library/Solarium/QueryType/Update/Query/Command/Add.php
+6
-3
No files found.
library/Solarium/QueryType/Update/Query/Command/Add.php
View file @
36b27d72
...
...
@@ -89,9 +89,12 @@ class Add extends Command
*/
public
function
addDocuments
(
$documents
)
{
foreach
(
$documents
as
$document
)
{
if
(
!
(
$document
instanceof
DocumentInterface
))
{
throw
new
RuntimeException
(
'Documents must implement DocumentInterface.'
);
//only check documents for type if in an array (iterating a Traversable may do unnecessary work)
if
(
is_array
(
$documents
))
{
foreach
(
$documents
as
$document
)
{
if
(
!
(
$document
instanceof
DocumentInterface
))
{
throw
new
RuntimeException
(
'Documents must implement DocumentInterface.'
);
}
}
}
...
...
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