Code Duplication    Length = 9-11 lines in 2 locations

class/PersistableObjectHandler.php 2 locations

@@ 245-255 (lines=11) @@
242
            $obj =& $this->create(false);
243
            $obj->assignVars($myrow);
244
            if (!$id_as_key) {
245
                if ($as_object) {
246
                    $ret[] =& $obj;
247
                } else {
248
                    $row     = array();
249
                    $vars    = $obj->getVars();
250
                    $tbl_tmp = array_keys($vars);
251
                    foreach ($tbl_tmp as $i) {
252
                        $row[$i] = $obj->getVar($i);
253
                    }
254
                    $ret[] = $row;
255
                }
256
            } else {
257
                if ($as_object) {
258
                    if ($fields === '*') {
@@ 263-271 (lines=9) @@
260
                    } else {
261
                        $ret[] =& $obj;
262
                    }
263
                } else {
264
                    $row     = array();
265
                    $vars    = $obj->getVars();
266
                    $tbl_tmp = array_keys($vars);
267
                    foreach ($tbl_tmp as $i) {
268
                        $row[$i] = $obj->getVar($i);
269
                    }
270
                    $ret[$myrow[$this->keyName]] = $row;
271
                }
272
            }
273
            unset($obj);
274
        }