Code Duplication    Length = 14-15 lines in 2 locations

src/Intraface/modules/debtor/Debtor.php 1 location

@@ 1152-1166 (lines=15) @@
1149
     * @return mixed object currency when currency set or false.
1150
     *
1151
     */
1152
    public function getCurrency()
1153
    {
1154
1155
        if ($this->get('currency_id') == 0 || $this->get('currency_product_price_exchange_rate_id') == 0) {
1156
            return false;
1157
        }
1158
1159
        if (!$this->currency) {
1160
            $doctrine = Doctrine_Manager::connection(DB_DSN);
1161
            $gateway = new Intraface_modules_currency_Currency_Gateway($doctrine);
1162
            $this->currency = $gateway->findById($this->get('currency_id'));
1163
        }
1164
1165
        return $this->currency;
1166
    }
1167
1168
    /**
1169
     * Returns the total amount on Debtor

src/Intraface/modules/onlinepayment/OnlinePayment.php 1 location

@@ 535-548 (lines=14) @@
532
    /**
533
     * Returns the currency if set, otherwise false
534
     */
535
    public function getCurrency()
536
    {
537
        if ($this->get('currency_id') == 0) {
538
            return false;
539
        }
540
541
        if (!$this->currency) {
542
            $doctrine = Doctrine_Manager::connection(DB_DSN);
543
            $gateway = new Intraface_modules_currency_Currency_Gateway($doctrine);
544
            $this->currency = $gateway->findById($this->get('currency_id'));
545
        }
546
547
        return $this->currency;
548
    }
549
550
    /**
551
     * Returns the amount in the given currency