From 10c8d19db9ad1639fa2b63bf3588ed7748817ed1 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Wed, 19 Oct 2011 12:16:16 +0000 Subject: add command parameter to _write_pre_process() --- it_dbi.class | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/it_dbi.class b/it_dbi.class index a183239..ec152d7 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -408,8 +408,9 @@ function _read_post_process() * Pre-process data before writing a record. * This is a stub-function that can be overloaded. * @param $tags Reference to update/create tags, can be modified as needed + * @param $command SQL command ('INSERT', 'REPLACE' or 'UPDATE') */ -function _write_pre_process(/* &$tags */) +function _write_pre_process(&$tags, $command) # NOPHPLINT { } @@ -643,7 +644,7 @@ function insert($tags = array(), $command = "INSERT") $this->_connect(); /* Pre-processing, $tags is passed by reference and may be modified here */ - $this->_write_pre_process($tags); + $this->_write_pre_process($tags, $command); if ($this->_p['randomid'] && !isset($tags[$this->_p['keyfield']])) $tags[$this->_p['keyfield']] = md5(uniqid(mt_rand())); @@ -688,7 +689,7 @@ function update($tags = array(), $where = null) $result = true; /* Pre-processing, $tags is passed by reference and may be modified here */ - $this->_write_pre_process($tags); + $this->_write_pre_process($tags, 'UPDATE'); if ($set = $this->_set($tags, isset($where))) { -- cgit v1.2.3