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
3f84f73e
Commit
3f84f73e
authored
Mar 30, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- bugfix for ReadWrite document array implementation
parent
bb26c423
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
library/Solarium/Document/ReadWrite.php
library/Solarium/Document/ReadWrite.php
+8
-7
No files found.
library/Solarium/Document/ReadWrite.php
View file @
3f84f73e
...
@@ -113,6 +113,7 @@ class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
...
@@ -113,6 +113,7 @@ class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
* Set a field value
* Set a field value
*
*
* If a field already has a value it will be overwritten.
* If a field already has a value it will be overwritten.
* If you supply NULL as the value the field will be removed
*
*
* @param string $key
* @param string $key
* @param mixed $value
* @param mixed $value
...
@@ -121,8 +122,12 @@ class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
...
@@ -121,8 +122,12 @@ class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
*/
*/
public
function
setField
(
$key
,
$value
,
$boost
=
null
)
public
function
setField
(
$key
,
$value
,
$boost
=
null
)
{
{
$this
->
_fields
[
$key
]
=
$value
;
if
(
$value
==
null
)
{
$this
->
setFieldBoost
(
$key
,
$boost
);
$this
->
removeField
(
$key
);
}
else
{
$this
->
_fields
[
$key
]
=
$value
;
$this
->
setFieldBoost
(
$key
,
$boost
);
}
return
$this
;
return
$this
;
}
}
...
@@ -210,11 +215,7 @@ class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
...
@@ -210,11 +215,7 @@ class Solarium_Document_ReadWrite extends Solarium_Document_ReadOnly
*/
*/
public
function
__set
(
$name
,
$value
)
public
function
__set
(
$name
,
$value
)
{
{
if
(
$value
==
null
)
{
$this
->
setField
(
$name
,
$value
);
$this
->
removeField
(
$name
);
}
else
{
$this
->
setField
(
$name
,
$value
);
}
}
}
}
}
\ 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