Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 612f126

Browse files
author
Michael Grauer
committed
BUG: refs #241. Cleaned out redundant save code.
The save method iterated over the data array twice, was it bit confusing and has been cleaned.
1 parent c205c9e commit 612f126

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

core/models/MIDASModel.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,12 @@ public function save($dao)
5656
throw new Zend_Exception("Should be an object (".$instance.").");
5757
}
5858

59-
$data = array();
59+
$dataarray = array();
6060
foreach($this->_mainData as $key => $var)
6161
{
6262
if(isset($dao->$key))
6363
{
64-
$data[$key] = $dao->$key;
65-
}
66-
}
67-
68-
$dataarray = array();
69-
foreach($data as $key => $d)
70-
{
71-
if(isset($this->_mainData[$key]))
72-
{
73-
$dataarray[$key] = $d;
64+
$dataarray[$key] = $dao->$key;
7465
}
7566
}
7667

@@ -404,4 +395,4 @@ public function compareDao($dao1, $dao2)
404395
return true;
405396
} //end method compareDao
406397

407-
} // end class GlobalModel
398+
} // end class GlobalModel

0 commit comments

Comments
 (0)