We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 250d99d9 authored by mattl's avatar mattl

Allow actions to be performed on updateWithKeys

Avoids overloading and lets dataobject classes use onUpdateKeys()
to do special stuff, like if a key is made up of a hash of other fields etc.
parent 8933022e
......@@ -483,6 +483,8 @@ abstract class Managed_DataObject extends Memcached_DataObject
throw new ServerException('DataObject must be the result of a query (N>=1) before updateWithKeys()');
}
$this->onUpdateKeys($orig);
// do it in a transaction
$this->query('BEGIN');
......@@ -580,6 +582,11 @@ abstract class Managed_DataObject extends Memcached_DataObject
// NOOP by default
}
protected function onUpdateKeys(Managed_DataObject $orig)
{
// NOOP by default
}
public function insert()
{
$this->onInsert();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment