Code Duplication    Length = 9-12 lines in 2 locations

class/PersistableObjectHandler.php 2 locations

@@ 186-197 (lines=12) @@
183
            $obj = $this->create(false);
184
            $obj->assignVars($myrow);
185
            if (!$id_as_key) {
186
                if ($as_object) {
187
                    $ret[] =& $obj;
188
                } else {
189
                    $row     = array();
190
                    $vars    = $obj->getVars();
191
                    $tbl_tmp = array_keys($vars);
192
                    foreach ($tbl_tmp as $i) {
193
                        $row[$i] = $obj->getVar($i);
194
                    }
195
                    $ret[] = $row;
196
                }
197
            } else {
198
                if ($as_object) {
199
                    $ret[$myrow[$this->keyName]] =& $obj;
200
                } else {
@@ 200-208 (lines=9) @@
197
            } else {
198
                if ($as_object) {
199
                    $ret[$myrow[$this->keyName]] =& $obj;
200
                } else {
201
                    $row     = array();
202
                    $vars    = $obj->getVars();
203
                    $tbl_tmp = array_keys($vars);
204
                    foreach ($tbl_tmp as $i) {
205
                        $row[$i] = $obj->getVar($i);
206
                    }
207
                    $ret[$myrow[$this->keyName]] = $row;
208
                }
209
            }
210
            unset($obj);
211
        }