Permalink
Browse files

Try to get value if property is not new and modified

  • Loading branch information...
1 parent b490f69 commit aa8b6c60a448856430daa39677d325da0a7ad158 @piotras piotras committed Apr 26, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Midgard/PHPCR/Node.php
@@ -205,13 +205,17 @@ public function setProperty($name, $value, $type = null)
$origValue = null;
try {
$property = $this->getProperty($name);
- $origValue = $property->getValue();
+ //$origValue = $property->getValue();
}
catch (PathNotFoundException $e) {
$this->properties[$name] = new Property($this, $name, $propertyDef, $type);
$property = $this->properties[$name];
$property->is_new = true;
}
+
+ if ($this->is_new === false && $this->is_modified === true) {
+ $origValue = $property->getValue();
+ }
$property->setValue($value, $type);
if (is_null($origValue) || $value != $origValue) {

0 comments on commit aa8b6c6

Please sign in to comment.