summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorUrban Müller2012-11-01 13:57:28 +0000
committerUrban Müller2012-11-01 13:57:28 +0000
commit2bd1adf0e007d8024d3a8f0c038d94d93e9ed819 (patch)
treedcb389db07ec952aa83a53b57f6d26659bcbee27 /it_dbi.class
parent1dccb8ce3b85438401de8a43a18bfb3c7a0a3576 (diff)
downloaditools-2bd1adf0e007d8024d3a8f0c038d94d93e9ed819.tar.gz
itools-2bd1adf0e007d8024d3a8f0c038d94d93e9ed819.tar.bz2
itools-2bd1adf0e007d8024d3a8f0c038d94d93e9ed819.zip
better function naming
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);
}