diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index e7b5e29c..aa323aee 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -426,6 +426,21 @@ abstract class DbObject return $this->autoincKeyName; } + public function getKeyParams() + { + $params = array();; + $key = $this->getKeyName(); + if (is_array($key)) { + foreach ($key as $k) { + $params[$k] = $this->get($k); + } + } else { + $params[$key] = $this->get($this->keyName); + } + + return $params; + } + /** * Return the unique identifier *