diff --git a/db/cursor.php b/db/cursor.php index 6edbc0e0..f007daaa 100644 --- a/db/cursor.php +++ b/db/cursor.php @@ -96,11 +96,11 @@ abstract function update(); abstract function copyfrom($var,$func=NULL); /** - * Populate hive array variable with mapper fields + * Populate array variable with mapper fields * @return NULL - * @param $key string + * @param $var mixed **/ - abstract function copyto($key); + abstract function copyto(&$var); /** * Get cursor's equivalent external iterator diff --git a/db/jig/mapper.php b/db/jig/mapper.php index 52f36acb..79e24924 100644 --- a/db/jig/mapper.php +++ b/db/jig/mapper.php @@ -497,12 +497,13 @@ function copyfrom($var,$func=NULL) { } /** - * Populate hive array variable with mapper fields + * Populate array variable with mapper fields * @return NULL - * @param $key string + * @param $var mixed **/ - function copyto($key) { - $var=&\Base::instance()->ref($key); + function copyto(&$var) { + if (is_string($var)) + $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 d5645412..f12dc65e 100644 --- a/db/mongo/mapper.php +++ b/db/mongo/mapper.php @@ -347,12 +347,13 @@ function copyfrom($var,$func=NULL) { } /** - * Populate hive array variable with mapper fields + * Populate array variable with mapper fields * @return NULL - * @param $key string + * @param $var mixed **/ - function copyto($key) { - $var=&\Base::instance()->ref($key); + function copyto($var) { + if (is_string($var)) + $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 9519cfab..3c65ff9f 100644 --- a/db/sql/mapper.php +++ b/db/sql/mapper.php @@ -603,12 +603,13 @@ function copyfrom($var,$func=NULL) { } /** - * Populate hive array variable with mapper fields + * Populate array variable with mapper fields * @return NULL - * @param $key string + * @param $var mixed **/ - function copyto($key) { - $var=&\Base::instance()->ref($key); + function copyto(&$var) { + if (is_string($var)) + $var=&\Base::instance()->ref($var); foreach ($this->fields+$this->adhoc as $key=>$field) $var[$key]=$field['value']; }