Code Duplication    Length = 8-9 lines in 3 locations

class/PersistableObjectHandler.php 3 locations

@@ 374-381 (lines=8) @@
371
            $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname;
372
        }
373
374
        if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
375
            $sql .= ' ' . $criteria->renderWhere();
376
            if ('' !== $criteria->getSort()) {
377
                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
378
            }
379
            $limit = $criteria->getLimit();
380
            $start = $criteria->getStart();
381
        }
382
        if ($debug) {
383
            xoops_debug($sql);
384
        }
@@ 405-413 (lines=9) @@
402
    {
403
        $ret = [];
404
405
        if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
406
            $sql .= ' ' . $criteria->renderWhere();
407
            if ($criteria->groupby) {
408
                $sql .= $criteria->getGroupby();
409
            }
410
            if ('' !== $criteria->getSort()) {
411
                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
412
            }
413
        }
414
        if ($debug) {
415
            xoops_debug($sql);
416
        }
@@ 543-550 (lines=8) @@
540
            $sql .= ', ' . $this->getIdentifierName();
541
        }
542
        $sql .= ' FROM ' . $this->table . ' AS ' . $this->_itemname;
543
        if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
544
            $sql .= ' ' . $criteria->renderWhere();
545
            if ('' !== $criteria->getSort()) {
546
                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
547
            }
548
            $limit = $criteria->getLimit();
549
            $start = $criteria->getStart();
550
        }
551
552
        if ($debug) {
553
            xoops_debug($sql);