summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 89b641f..1bb36e0 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -684,10 +684,11 @@ function replace($tags = array())
/**
- * Update a record (efficiently) or create it if missing
+ * Create a record like replace(), but optimize if similar or identical record already exists
+ * MUST GIVE ALL FIELDS INCLUDING ID
* @param $tags key => value pairs to set
*/
-function store($tags = array())
+function smart_replace($tags = array())
{
return $tags[$this->_p['keyfield']] && $this->read($tags[$this->_p['keyfield']]) ? $this->update($tags) : $this->replace($tags);
}