Code Duplication    Length = 9-11 lines in 2 locations

class/PersistableObjectHandler.php 2 locations

@@ 261-271 (lines=11) @@
258
            $obj = $this->create(false);
259
            $obj->assignVars($myrow);
260
            if (!$id_as_key) {
261
                if ($as_object) {
262
                    $ret[] = $obj;
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[] = $row;
271
                }
272
            } else {
273
                if ($as_object) {
274
                    if ($fields === '*') {
@@ 279-287 (lines=9) @@
276
                    } else {
277
                        $ret[] = $obj;
278
                    }
279
                } else {
280
                    $row     = array();
281
                    $vars    = $obj->getVars();
282
                    $tbl_tmp = array_keys($vars);
283
                    foreach ($tbl_tmp as $i) {
284
                        $row[$i] = $obj->getVar($i);
285
                    }
286
                    $ret[$myrow[$this->keyName]] = $row;
287
                }
288
            }
289
            unset($obj);
290
        }