Skip to content

Commit

Permalink
Revert "Allow copyTo() to save field values to regular PHP variables"
Browse files Browse the repository at this point in the history
This reverts commit 8364951.
  • Loading branch information
ikkez authored and nanawel committed Sep 15, 2018
1 parent 71d3799 commit f19e804
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions db/cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions db/jig/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 4 additions & 5 deletions db/mongo/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 4 additions & 5 deletions db/sql/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand Down

0 comments on commit f19e804

Please sign in to comment.