Code Duplication    Length = 11-11 lines in 3 locations

plugin/buycourses/src/buy_course_plugin.class.php 3 locations

@@ 790-800 (lines=11) @@
787
     * @param int $itemId The item ID
788
     * @return array
789
     */
790
    public function getItem($itemId)
791
    {
792
        return Database::select(
793
            '*',
794
            Database::get_main_table(self::TABLE_ITEM),
795
            [
796
                'where' => ['id = ?' => intval($itemId)]
797
            ],
798
            'first'
799
        );
800
    }
801
802
    /**
803
     * Register a sale
@@ 864-874 (lines=11) @@
861
     * @param int $saleId The sale ID
862
     * @return array
863
     */
864
    public function getSale($saleId)
865
    {
866
        return Database::select(
867
            '*',
868
            Database::get_main_table(self::TABLE_SALE),
869
            [
870
                'where' => ['id = ?' => intval($saleId)]
871
            ],
872
            'first'
873
        );
874
    }
875
876
    /**
877
     * Get a list of sales by the payment type
@@ 907-917 (lines=11) @@
904
     * @param int $currencyId The currency ID
905
     * @return array
906
     */
907
    public function getCurrency($currencyId)
908
    {
909
        return Database::select(
910
            '*',
911
            Database::get_main_table(self::TABLE_CURRENCY),
912
            [
913
                'where' => ['id = ?' => intval($currencyId)]
914
            ],
915
            'first'
916
        );
917
    }
918
919
    /**
920
     * Update the sale status