src/ShopBundle/objects/WebModules/MTShopBasketCore/MTShopBasketCoreEndpoint.class.php
protected function getValidVoucher($sShopVoucherCode)
    {
        $oValidVoucher = null;
        /** @var $oVoucher TdbShopVoucher */
        $oVoucher = TdbShopVoucher::GetNewInstance();

        if (strlen($sShopVoucherCode) >= 3) {
            if ($oVoucher->LoadFromFields(array('code' => $sShopVoucherCode, 'is_used_up' => '0'))) {
                $oValidVoucher = $oVoucher;
            }
        }

        return $oValidVoucher;
    }
protected function getValidVoucher($sShopVoucherCode)
    {
        $oValidVoucher = null;
        /** @var $oVoucher TdbShopVoucher */
        $oVoucher = TdbShopVoucher::GetNewInstance();

        if (strlen($sShopVoucherCode) >= 3) {
            if ($oVoucher->LoadFromFields(array('code' => $sShopVoucherCode, 'is_used_up' => '0'))) {
                $oValidVoucher = $oVoucher;
            }
        }

        return $oValidVoucher;
    }
protected function getValidVoucher ( $ sShopVoucherCode ) { $ oValidVoucher = null ; /** @var $oVoucher TdbShopVoucher */ $ oVoucher = TdbShopVoucher :: GetNewInstance ( ) ; if ( strlen ( $ sShopVoucherCode ) >= 3 ) { if ( $ oVoucher -> LoadFromFields ( array ( 'code' => $ sShopVoucherCode , 'is_used_up' => '0' ) ) ) { $ oValidVoucher = $ oVoucher ; } } return $ oValidVoucher ; }
validates the voucher code and tries to load the voucher record.

@param $sShopVoucherCode

@return TdbShopVoucher|null
validates the voucher code and tries to load the voucher record .