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
5c2adfa1
Commit
5c2adfa1
authored
Nov 13, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved exception logic
parent
db2490de
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
21 deletions
+12
-21
library/Solarium/Query/Select.php
library/Solarium/Query/Select.php
+4
-7
library/Solarium/Query/Select/Component/FacetSet.php
library/Solarium/Query/Select/Component/FacetSet.php
+4
-7
library/Solarium/Query/Select/Component/Stats.php
library/Solarium/Query/Select/Component/Stats.php
+4
-7
No files found.
library/Solarium/Query/Select.php
View file @
5c2adfa1
...
@@ -573,13 +573,10 @@ class Solarium_Query_Select extends Solarium_Query
...
@@ -573,13 +573,10 @@ class Solarium_Query_Select extends Solarium_Query
throw
new
Solarium_Exception
(
'A filterquery must have a key value'
);
throw
new
Solarium_Exception
(
'A filterquery must have a key value'
);
}
}
if
(
array_key_exists
(
$key
,
$this
->
_filterQueries
))
{
//double add calls for the same FQ are ignored, but non-unique keys cause an exception
if
(
$this
->
_filterQueries
[
$key
]
===
$filterQuery
)
{
//@todo add trigger_error with a notice for double add calls?
//double add calls for the same FQ are ignored
if
(
array_key_exists
(
$key
,
$this
->
_filterQueries
)
&&
$this
->
_filterQueries
[
$key
]
!==
$filterQuery
)
{
//@todo add trigger_error with a notice?
}
else
{
throw
new
Solarium_Exception
(
'A filterquery must have a unique key value within a query'
);
throw
new
Solarium_Exception
(
'A filterquery must have a unique key value within a query'
);
}
}
else
{
}
else
{
$this
->
_filterQueries
[
$key
]
=
$filterQuery
;
$this
->
_filterQueries
[
$key
]
=
$filterQuery
;
}
}
...
...
library/Solarium/Query/Select/Component/FacetSet.php
View file @
5c2adfa1
...
@@ -266,13 +266,10 @@ class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Com
...
@@ -266,13 +266,10 @@ class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Com
throw
new
Solarium_Exception
(
'A facet must have a key value'
);
throw
new
Solarium_Exception
(
'A facet must have a key value'
);
}
}
if
(
array_key_exists
(
$key
,
$this
->
_facets
))
{
//double add calls for the same facet are ignored, but non-unique keys cause an exception
if
(
$this
->
_facets
[
$key
]
===
$facet
)
{
//@todo add trigger_error with a notice for double add calls?
//double add calls for the same facet are ignored
if
(
array_key_exists
(
$key
,
$this
->
_facets
)
&&
$this
->
_facets
[
$key
]
!==
$facet
)
{
//@todo add trigger_error with a notice?
}
else
{
throw
new
Solarium_Exception
(
'A facet must have a unique key value within a query'
);
throw
new
Solarium_Exception
(
'A facet must have a unique key value within a query'
);
}
}
else
{
}
else
{
$this
->
_facets
[
$key
]
=
$facet
;
$this
->
_facets
[
$key
]
=
$facet
;
}
}
...
...
library/Solarium/Query/Select/Component/Stats.php
View file @
5c2adfa1
...
@@ -140,13 +140,10 @@ class Solarium_Query_Select_Component_Stats extends Solarium_Query_Select_Compon
...
@@ -140,13 +140,10 @@ class Solarium_Query_Select_Component_Stats extends Solarium_Query_Select_Compon
throw
new
Solarium_Exception
(
'A field must have a key value'
);
throw
new
Solarium_Exception
(
'A field must have a key value'
);
}
}
if
(
array_key_exists
(
$key
,
$this
->
_fields
))
{
//double add calls for the same field are ignored, but non-unique keys cause an exception
if
(
$this
->
_fields
[
$key
]
===
$field
)
{
//@todo add trigger_error with a notice for double add calls?
//double add calls for the same FQ are ignored
if
(
array_key_exists
(
$key
,
$this
->
_fields
)
&&
$this
->
_fields
[
$key
]
!==
$field
)
{
//@todo add trigger_error with a notice?
}
else
{
throw
new
Solarium_Exception
(
'A field must have a unique key value'
);
throw
new
Solarium_Exception
(
'A field must have a unique key value'
);
}
}
else
{
}
else
{
$this
->
_fields
[
$key
]
=
$field
;
$this
->
_fields
[
$key
]
=
$field
;
}
}
...
...
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