diff options
author | Christian Weber | 2011-10-19 12:16:16 +0000 |
---|---|---|
committer | Christian Weber | 2011-10-19 12:16:16 +0000 |
commit | 10c8d19db9ad1639fa2b63bf3588ed7748817ed1 (patch) | |
tree | 927299b593c1c7f4e068d87e2d2b2295667d43f9 | |
parent | 02ccb38840911a072be84f6d075c88d9c8054969 (diff) | |
download | itools-10c8d19db9ad1639fa2b63bf3588ed7748817ed1.tar.gz itools-10c8d19db9ad1639fa2b63bf3588ed7748817ed1.tar.bz2 itools-10c8d19db9ad1639fa2b63bf3588ed7748817ed1.zip |
add command parameter to _write_pre_process()
-rw-r--r-- | it_dbi.class | 7 |
1 files 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))) { |