Code Duplication    Length = 28-29 lines in 2 locations

Classes/IndexQueue/Queue.php 2 locations

@@ 546-573 (lines=28) @@
543
     * @param string $itemType The type of the item to remove, usually a table name.
544
     * @param integer $itemUid The uid of the item to remove
545
     */
546
    public function deleteItem($itemType, $itemUid)
547
    {
548
        $uidList = array();
549
550
        // get the item uids to use them in the deletes afterwards
551
        $items = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
552
            'uid',
553
            'tx_solr_indexqueue_item',
554
            'item_type = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($itemType,
555
                'tx_solr_indexqueue_item') .
556
            ' AND item_uid = ' . intval($itemUid)
557
        );
558
559
        if (count($items)) {
560
            foreach ($items as $item) {
561
                $uidList[] = $item['uid'];
562
            }
563
564
            $GLOBALS['TYPO3_DB']->exec_DELETEquery(
565
                'tx_solr_indexqueue_item',
566
                'uid IN(' . implode(',', $uidList) . ')'
567
            );
568
            $GLOBALS['TYPO3_DB']->exec_DELETEquery(
569
                'tx_solr_indexqueue_indexing_property',
570
                'item_id IN(' . implode(',', $uidList) . ')'
571
            );
572
        }
573
    }
574
575
    /**
576
     * Removes all items of a certain type from the Index Queue.
@@ 580-608 (lines=29) @@
577
     *
578
     * @param string $itemType The type of items to remove, usually a table name.
579
     */
580
    public function deleteItemsByType($itemType)
581
    {
582
        $uidList = array();
583
584
        // get the item uids to use them in the deletes afterwards
585
        $items = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
586
            'uid',
587
            'tx_solr_indexqueue_item',
588
            'item_type = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr(
589
                $itemType,
590
                'tx_solr_indexqueue_item'
591
            )
592
        );
593
594
        if (count($items)) {
595
            foreach ($items as $item) {
596
                $uidList[] = $item['uid'];
597
            }
598
599
            $GLOBALS['TYPO3_DB']->exec_DELETEquery(
600
                'tx_solr_indexqueue_item',
601
                'uid IN(' . implode(',', $uidList) . ')'
602
            );
603
            $GLOBALS['TYPO3_DB']->exec_DELETEquery(
604
                'tx_solr_indexqueue_indexing_property',
605
                'item_id IN(' . implode(',', $uidList) . ')'
606
            );
607
        }
608
    }
609
610
    /**
611
     * Removes all items of a certain site from the Index Queue. Accepts an