Code Duplication    Length = 10-11 lines in 2 locations

class/category.php 1 location

@@ 701-711 (lines=11) @@
698
     * @param  bool           $asObject
699
     * @return bool FALSE if deletion failed
700
     */
701
    public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) //deleteAll($criteria = null)
702
    {
703
        $categories = $this->getObjects($criteria);
704
        foreach ($categories as $category) {
705
            if (!$this->delete($category)) {
706
                return false;
707
            }
708
        }
709
710
        return true;
711
    }
712
713
    /**
714
     * @param int $catId

class/item.php 1 location

@@ 1617-1626 (lines=10) @@
1614
     * @param  bool           $asObject
1615
     * @return bool FALSE if deletion failed
1616
     */
1617
    public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) //deleteAll($criteria = null)
1618
    {
1619
        //todo resource consuming, use get list instead?
1620
        $items = $this->getObjects($criteria);
1621
        foreach ($items as $item) {
1622
            $this->delete($item);
1623
        }
1624
1625
        return true;
1626
    }
1627
1628
    /**
1629
     * @param $itemid