From 5555b40c2a126cecc1d85d992c6862e53fee1c60 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 25 Jun 2020 20:07:20 +0200 Subject: Streamline _read_postprocess: remove support for unset(), add support to postprocess localized fields, conversion of fields (e.g. int fields) is now done after read_postprocess --- it_dbi.class | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index 2c16b90..ceb5241 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -729,8 +729,8 @@ function iterate() $this->_data[$field] = $value; unset($this->_data['dyncols']); - foreach ($this->_data as $field => $value) - $this->$field = (isset($value) && $this->_convertfunc[$field]) ? ($this->_data[$field] = $this->_convertfunc[$field]($value)) : $value; + foreach (static::_read_postprocess($this->_data) as $field => $value) + $this->$field = $this->_data[$field] = (isset($value) && $this->_convertfunc[$field]) ? $this->_convertfunc[$field]($value) : $value; if ($localizedfields) { @@ -762,18 +762,6 @@ function iterate() $this->_result->close(); } - if (is_array($this->_data)) - { - $originalfields = array_keys($this->_data); - $this->_data = static::_read_postprocess($this->_data, $this); - # Remove fields which have been unset in _read_postprocess - foreach (array_diff($originalfields, array_keys($this->_data)) as $field) - unset($this->$field); - # Update fields as they may have been changed in _read_postprocess - foreach ($this->_data as $field => $value) - $this->$field = $value; - } - $this->_read_post_process(); } else -- cgit v1.2.3