From 2bd1adf0e007d8024d3a8f0c038d94d93e9ed819 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 1 Nov 2012 13:57:28 +0000 Subject: better function naming --- it_dbi.class | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'it_dbi.class') 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); } -- cgit v1.2.3