Code Duplication    Length = 8-8 lines in 2 locations

class/ExtcalPersistableObjectHandler.php 2 locations

@@ 131-138 (lines=8) @@
128
        $ret   = [];
129
        $limit = $start = 0;
130
        $sql   = 'SELECT * FROM ' . $this->table;
131
        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
132
            $sql .= ' ' . $criteria->renderWhere();
133
            if ('' != $criteria->getSort()) {
134
                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
135
            }
136
            $limit = $criteria->getLimit();
137
            $start = $criteria->getStart();
138
        }
139
        $result = $this->db->query($sql, $limit, $start);
140
        if (!$result) {
141
            return $ret;
@@ 218-225 (lines=8) @@
215
            $sql .= ', ' . $this->identifierName;
216
        }
217
        $sql .= ' FROM ' . $this->table;
218
        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
219
            $sql .= ' ' . $criteria->renderWhere();
220
            if ('' != $criteria->getSort()) {
221
                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
222
            }
223
            $limit = $criteria->getLimit();
224
            $start = $criteria->getStart();
225
        }
226
        $result = $this->db->query($sql, $limit, $start);
227
        if (!$result) {
228
            return $ret;