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
30003238
Commit
30003238
authored
Apr 15, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added support for configuration mode to the update query
parent
b6698661
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
library/Solarium/Query/Update.php
library/Solarium/Query/Update.php
+35
-0
No files found.
library/Solarium/Query/Update.php
View file @
30003238
...
@@ -68,6 +68,41 @@ class Solarium_Query_Update extends Solarium_Query
...
@@ -68,6 +68,41 @@ class Solarium_Query_Update extends Solarium_Query
*/
*/
protected
$_commands
=
array
();
protected
$_commands
=
array
();
/**
* Initialize options
*
* Several options need some extra checks or setup work, for these options
* the setters are called.
*
* @return void
*/
protected
function
_init
()
{
if
(
isset
(
$this
->
_options
[
'command'
]))
{
foreach
(
$this
->
_options
[
'command'
]
as
$key
=>
$value
)
{
switch
(
$value
[
'type'
])
{
case
'delete'
:
$command
=
new
Solarium_Query_Update_Command_Delete
(
$value
);
break
;
case
'commit'
:
$command
=
new
Solarium_Query_Update_Command_Commit
(
$value
);
break
;
case
'optimize'
:
$command
=
new
Solarium_Query_Update_Command_Optimize
(
$value
);
break
;
case
'rollback'
:
$command
=
new
Solarium_Query_Update_Command_Rollback
(
$value
);
break
;
case
'add'
:
throw
new
Solarium_Exception
(
"Adding documents is not supported in configuration, use the API for this"
);
}
$this
->
add
(
$key
,
$command
);
}
}
}
/**
/**
* Get all commands for this update query
* Get all commands for this update query
*
*
...
...
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