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
7cfb5d74
Commit
7cfb5d74
authored
Aug 12, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented remove by object
parent
e64ce311
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
29 deletions
+84
-29
library/Solarium/Client.php
library/Solarium/Client.php
+17
-5
library/Solarium/Query/Select.php
library/Solarium/Query/Select.php
+27
-9
library/Solarium/Query/Select/Component/Facet/MultiQuery.php
library/Solarium/Query/Select/Component/Facet/MultiQuery.php
+11
-5
library/Solarium/Query/Select/Component/FacetSet.php
library/Solarium/Query/Select/Component/FacetSet.php
+11
-5
library/Solarium/Query/Update.php
library/Solarium/Query/Update.php
+18
-5
No files found.
library/Solarium/Client.php
View file @
7cfb5d74
...
...
@@ -359,13 +359,25 @@ class Solarium_Client extends Solarium_Configurable
/**
* Remove a plugin instance
*
* @param string $key
* You can remove a plugin by passing the plugin key, or the plugin instance
*
* @param string|Solarium_Plugin_Abstract $plugin
* @return Solarium_Client Provides fluent interface
*/
public
function
removePlugin
(
$
key
)
public
function
removePlugin
(
$
plugin
)
{
if
(
isset
(
$this
->
_plugins
[
$key
]))
{
if
(
is_object
(
$plugin
))
{
foreach
(
$this
->
_plugins
as
$key
=>
$instance
)
{
if
(
$instance
===
$plugin
)
{
unset
(
$this
->
_plugins
[
$key
]);
break
;
}
}
}
else
{
if
(
isset
(
$this
->
_plugins
[
$plugin
]))
{
unset
(
$this
->
_plugins
[
$plugin
]);
}
}
return
$this
;
}
...
...
library/Solarium/Query/Select.php
View file @
7cfb5d74
...
...
@@ -581,15 +581,21 @@ class Solarium_Query_Select extends Solarium_Query
}
/**
* Remove a single filterquery
by key
* Remove a single filterquery
*
* @param string $key
* You can remove a filterquery by passing it's key, or by passing the filterquery instance
*
* @param string|Solarium_Query_Select_FilterQuery $filterQuery
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
removeFilterQuery
(
$
ke
y
)
public
function
removeFilterQuery
(
$
filterQuer
y
)
{
if
(
isset
(
$this
->
_filterQueries
[
$key
]))
{
unset
(
$this
->
_filterQueries
[
$key
]);
if
(
is_object
(
$filterQuery
))
{
$filterQuery
=
$filterQuery
->
getKey
();
}
if
(
isset
(
$this
->
_filterQueries
[
$filterQuery
]))
{
unset
(
$this
->
_filterQueries
[
$filterQuery
]);
}
return
$this
;
...
...
@@ -708,13 +714,25 @@ class Solarium_Query_Select extends Solarium_Query
/**
* Remove a component instance
*
* @param string $key
* You can remove a component by passing it's key or the component instance
*
* @param string|Solarium_Query_Select_Component $component
* @return Solarium_Query_Select Provides fluent interface
*/
public
function
removeComponent
(
$
key
)
public
function
removeComponent
(
$
component
)
{
if
(
isset
(
$this
->
_components
[
$key
]))
{
if
(
is_object
(
$component
))
{
foreach
(
$this
->
_components
as
$key
=>
$instance
)
{
if
(
$instance
===
$component
)
{
unset
(
$this
->
_components
[
$key
]);
break
;
}
}
}
else
{
if
(
isset
(
$this
->
_components
[
$component
]))
{
unset
(
$this
->
_components
[
$component
]);
}
}
return
$this
;
}
...
...
library/Solarium/Query/Select/Component/Facet/MultiQuery.php
View file @
7cfb5d74
...
...
@@ -191,15 +191,21 @@ class Solarium_Query_Select_Component_Facet_MultiQuery extends Solarium_Query_Se
}
/**
* Remove a single facetquery
by key
* Remove a single facetquery
*
* @param string $key
* You can remove a facetquery by passing it's key or the facetquery instance
*
* @param string|Solarium_Query_Select_Component_Facet_Query $query
* @return Solarium_Query_Select_Component_Facet_MultiQuery Provides fluent interface
*/
public
function
removeQuery
(
$
ke
y
)
public
function
removeQuery
(
$
quer
y
)
{
if
(
isset
(
$this
->
_facetQueries
[
$key
]))
{
unset
(
$this
->
_facetQueries
[
$key
]);
if
(
is_object
(
$query
))
{
$query
=
$query
->
getKey
();
}
if
(
isset
(
$this
->
_facetQueries
[
$query
]))
{
unset
(
$this
->
_facetQueries
[
$query
]);
}
return
$this
;
...
...
library/Solarium/Query/Select/Component/FacetSet.php
View file @
7cfb5d74
...
...
@@ -322,15 +322,21 @@ class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Com
}
/**
* Remove a single facet
by key
* Remove a single facet
*
* @param string $key
* You can remove a facet by passing it's key or the facet instance
*
* @param string|Solarium_Query_Select_Component_Facet $facet
* @return Solarium_Query Provides fluent interface
*/
public
function
removeFacet
(
$
key
)
public
function
removeFacet
(
$
facet
)
{
if
(
isset
(
$this
->
_facets
[
$key
]))
{
unset
(
$this
->
_facets
[
$key
]);
if
(
is_object
(
$facet
))
{
$facet
=
$facet
->
getKey
();
}
if
(
isset
(
$this
->
_facets
[
$facet
]))
{
unset
(
$this
->
_facets
[
$facet
]);
}
return
$this
;
...
...
library/Solarium/Query/Update.php
View file @
7cfb5d74
...
...
@@ -197,16 +197,29 @@ class Solarium_Query_Update extends Solarium_Query
}
/**
* Remove a command
by key
* Remove a command
*
* @param string $key
* You can remove a command by passing it's key or by passing the command instance
*
* @param string|Solarium_Query_Update_Command $command
* @return Solarium_Query_Update Provides fluent interface
*/
public
function
remove
(
$
key
)
public
function
remove
(
$
command
)
{
if
(
isset
(
$this
->
_commands
[
$key
]))
{
if
(
is_object
(
$command
))
{
foreach
(
$this
->
_commands
as
$key
=>
$instance
)
{
if
(
$instance
===
$command
)
{
unset
(
$this
->
_commands
[
$key
]);
break
;
}
}
}
else
{
if
(
isset
(
$this
->
_commands
[
$command
]))
{
unset
(
$this
->
_commands
[
$command
]);
}
}
return
$this
;
}
...
...
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