From 79d64a1641a7ac0c2356a0cdeda7f33b33d2c27c Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Tue, 4 Sep 2007 13:28:34 +0000 Subject: add warning if member vars would influence update/insert (deprecated behaviour) --- it_dbi.class | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/it_dbi.class b/it_dbi.class index de5d13a..16fe7dc 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -175,11 +175,15 @@ function createclass($table) */ function _set(&$tags) { - # Add member vars to tags, considering unquoted fields + # DEPRECATED BEHAVIOUR: Add member vars to tags, considering unquoted fields foreach (get_object_vars($this) as $field => $value) # Don't use isset($tags[$field]) (would not handle null values correctly) if (isset($this->_fields[$field]) && !array_key_exists('-'.$field, $tags) && !array_key_exists($field, $tags)) + { $tags[$field] = $value; + if ($this->_data && ($value != $this->_data[$field])) + it::error("it_dbi::_set() would take value '$value' from this->$field:" . D($_this)); + } # Create SQL $r = array(); -- cgit v1.2.3