Code Duplication    Length = 11-12 lines in 4 locations

Helper/Database.php 4 locations

@@ 77-88 (lines=12) @@
74
     * @param  string $sStatus
75
     * @return string
76
     */
77
    public function getStateByStatus($sStatus)
78
    {
79
        $sQuery = " SELECT
80
                        state
81
                    FROM
82
                        ".$this->databaseResource->getTableName('sales_order_status_state')."
83
                    WHERE
84
                        status = :status
85
                    LIMIT 1";
86
        $sState = $this->getDb()->fetchOne($sQuery, ['status' => $sStatus]);
87
        return $sState;
88
    }
89
90
    /**
91
     * Get the order increment id by the given TransactionStatus txid
@@ 96-107 (lines=12) @@
93
     * @param  string $sTxid
94
     * @return string
95
     */
96
    public function getOrderIncrementIdByTxid($sTxid)
97
    {
98
        $sQuery = " SELECT
99
                        order_id
100
                    FROM
101
                        ".$this->databaseResource->getTableName('payone_protocol_api')."
102
                    WHERE
103
                        txid = :txid
104
                    LIMIT 1";
105
        $sIncrementId = $this->getDb()->fetchOne($sQuery, ['txid' => $sTxid]);
106
        return $sIncrementId;
107
    }
108
109
    /**
110
     * Get module info from db
@@ 132-142 (lines=11) @@
129
     * @param  string $sOrderId
130
     * @return string|bool
131
     */
132
    public function getIncrementIdByOrderId($sOrderId)
133
    {
134
        $sQuery = " SELECT
135
                        increment_id
136
                    FROM
137
                        ".$this->databaseResource->getTableName('sales_order')."
138
                    WHERE
139
                        entity_id = :entity_id";
140
        $sIncrementId = $this->getDb()->fetchOne($sQuery, ['entity_id' => $sOrderId]);
141
        return $sIncrementId;
142
    }
143
144
    /**
145
     * Get payone user id by given customer nr
@@ 150-161 (lines=12) @@
147
     * @param  string $sCustNr
148
     * @return string
149
     */
150
    public function getPayoneUserIdByCustNr($sCustNr)
151
    {
152
        $sQuery = " SELECT
153
                        userid
154
                    FROM
155
                        ".$this->databaseResource->getTableName('payone_protocol_transactionstatus')."
156
                    WHERE
157
                        customerid = :customerid
158
                    LIMIT 1";
159
        $sUserId = $this->getDb()->fetchOne($sQuery, ['customerid' => $sCustNr]);
160
        return $sUserId;
161
    }
162
163
    /**
164
     * Get the next sequencenumber for this transaction