From 7596cfb8d0faaf16fd5939397ff10843f1856367 Mon Sep 17 00:00:00 2001 From: ikkez Date: Sat, 11 Aug 2018 17:46:40 +0200 Subject: [PATCH] Revert "Allow copyTo() to save field values to regular PHP variables" This reverts commit 836495179ae6a72a2488af30ac9573080ee542dc. --- db/cursor.php | 6 +++--- db/jig/mapper.php | 9 ++++----- db/mongo/mapper.php | 9 ++++----- db/sql/mapper.php | 9 ++++----- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/db/cursor.php b/db/cursor.php index f007daaa..6edbc0e0 100644 --- a/db/cursor.php +++ b/db/cursor.php @@ -96,11 +96,11 @@ abstract function update(); abstract function copyfrom($var,$func=NULL); /** - * Populate array variable with mapper fields + * Populate hive array variable with mapper fields * @return NULL - * @param $var mixed + * @param $key string **/ - abstract function copyto(&$var); + abstract function copyto($key); /** * Get cursor's equivalent external iterator diff --git a/db/jig/mapper.php b/db/jig/mapper.php index 79e24924..52f36acb 100644 --- a/db/jig/mapper.php +++ b/db/jig/mapper.php @@ -497,13 +497,12 @@ function copyfrom($var,$func=NULL) { } /** - * Populate array variable with mapper fields + * Populate hive array variable with mapper fields * @return NULL - * @param $var mixed + * @param $key string **/ - function copyto(&$var) { - if (is_string($var)) - $var=&\Base::instance()->ref($key); + function copyto($key) { + $var=&\Base::instance()->ref($key); foreach ($this->document as $key=>$field) $var[$key]=$field; } diff --git a/db/mongo/mapper.php b/db/mongo/mapper.php index f12dc65e..d5645412 100644 --- a/db/mongo/mapper.php +++ b/db/mongo/mapper.php @@ -347,13 +347,12 @@ function copyfrom($var,$func=NULL) { } /** - * Populate array variable with mapper fields + * Populate hive array variable with mapper fields * @return NULL - * @param $var mixed + * @param $key string **/ - function copyto($var) { - if (is_string($var)) - $var=&\Base::instance()->ref($key); + function copyto($key) { + $var=&\Base::instance()->ref($key); foreach ($this->document as $key=>$field) $var[$key]=$field; } diff --git a/db/sql/mapper.php b/db/sql/mapper.php index 3c65ff9f..9519cfab 100644 --- a/db/sql/mapper.php +++ b/db/sql/mapper.php @@ -603,13 +603,12 @@ function copyfrom($var,$func=NULL) { } /** - * Populate array variable with mapper fields + * Populate hive array variable with mapper fields * @return NULL - * @param $var mixed + * @param $key string **/ - function copyto(&$var) { - if (is_string($var)) - $var=&\Base::instance()->ref($var); + function copyto($key) { + $var=&\Base::instance()->ref($key); foreach ($this->fields+$this->adhoc as $key=>$field) $var[$key]=$field['value']; }