Code Duplication    Length = 8-10 lines in 2 locations

class/ExtcalPersistableObjectHandler.php 2 locations

@@ 165-174 (lines=10) @@
162
            $obj = $this->create(false);
163
            $obj->assignVars($myrow);
164
            if (!$idAsKey) {
165
                if ($asObject) {
166
                    $ret[] = $obj;
167
                } else {
168
                    $row  = [];
169
                    $vars =& $obj->getVars();
170
                    foreach (array_keys($vars) as $i) {
171
                        $row[$i] = $obj->getVar($i);
172
                    }
173
                    $ret[] = $row;
174
                }
175
            } else {
176
                if ($asObject) {
177
                    $ret[$myrow[$this->keyName]] = $obj;
@@ 178-185 (lines=8) @@
175
            } else {
176
                if ($asObject) {
177
                    $ret[$myrow[$this->keyName]] = $obj;
178
                } else {
179
                    $row  = [];
180
                    $vars =& $obj->getVars();
181
                    foreach (array_keys($vars) as $i) {
182
                        $row[$i] = $obj->getVar($i);
183
                    }
184
                    $ret[$myrow[$this->keyName]] = $row;
185
                }
186
            }
187
            unset($obj);
188
        }