When locking, use the results to reload the object fields fresh as they may have changed since the object was loaded
This commit is contained in:
parent
cf87f2cc40
commit
ae1e3d88b2
|
@ -434,6 +434,11 @@ class ZM_Object {
|
||||||
$row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($this->Id()));
|
$row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($this->Id()));
|
||||||
if ( !$row ) {
|
if ( !$row ) {
|
||||||
Error("Unable to lock $class record for Id=".$this->Id());
|
Error("Unable to lock $class record for Id=".$this->Id());
|
||||||
|
} else {
|
||||||
|
// row may have been modified since initial load
|
||||||
|
foreach ($row as $k => $v) {
|
||||||
|
$this->{$k} = $v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function remove_from_cache() {
|
public function remove_from_cache() {
|
||||||
|
|
Loading…
Reference in New Issue