Code Duplication    Length = 11-11 lines in 3 locations

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

@@ 812-822 (lines=11) @@
809
     * @param int $itemId The item ID
810
     * @return array
811
     */
812
    public function getItem($itemId)
813
    {
814
        return Database::select(
815
            '*',
816
            Database::get_main_table(self::TABLE_ITEM),
817
            [
818
                'where' => ['id = ?' => intval($itemId)],
819
            ],
820
            'first'
821
        );
822
    }
823
824
    /**
825
     * Register a sale
@@ 886-896 (lines=11) @@
883
     * @param int $saleId The sale ID
884
     * @return array
885
     */
886
    public function getSale($saleId)
887
    {
888
        return Database::select(
889
            '*',
890
            Database::get_main_table(self::TABLE_SALE),
891
            [
892
                'where' => ['id = ?' => intval($saleId)],
893
            ],
894
            'first'
895
        );
896
    }
897
898
    /**
899
     * Get a list of sales by the payment type
@@ 929-939 (lines=11) @@
926
     * @param int $currencyId The currency ID
927
     * @return array
928
     */
929
    public function getCurrency($currencyId)
930
    {
931
        return Database::select(
932
            '*',
933
            Database::get_main_table(self::TABLE_CURRENCY),
934
            [
935
                'where' => ['id = ?' => intval($currencyId)],
936
            ],
937
            'first'
938
        );
939
    }
940
941
    /**
942
     * Update the sale status