當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Currency::setName方法代碼示例

本文整理匯總了PHP中Currency::setName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Currency::setName方法的具體用法?PHP Currency::setName怎麽用?PHP Currency::setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Currency的用法示例。


在下文中一共展示了Currency::setName方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addToCollection

 protected function addToCollection($currencyParams, $currencyCollection)
 {
     $currencyObj = new Currency();
     $currencyObj->setSource($currencyParams['source']);
     $currencyObj->setType($currencyParams['type']);
     $currencyObj->setCode($currencyParams['code']);
     $currencyObj->setName($currencyParams['name']);
     $currencyObj->setPrice(floatval(str_replace(',', '.', $currencyParams['price'])));
     $currencyCollection->add($currencyObj);
 }
開發者ID:dneprix,項目名稱:esky,代碼行數:10,代碼來源:CurrencyFactoryAbstract.php

示例2: getCurrencies

 protected function getCurrencies()
 {
     $wikipedia = $this->web->get(sfConfig::get('app_source_currencies'), null, array('User-Agent' => 'Steve Lacey <steve@stevelacey.net>', 'Cache-Control' => 'no-cache'));
     $xml = new SimpleXMLElement($wikipedia->getResponseText());
     $article = $xml->page->revision->text;
     $table = substr($article, strpos($article, '{|'), strpos($article, '|}') - strpos($article, '{|'));
     foreach (explode('-| ', str_replace(array('[', ']', "\n"), '', $table)) as $row) {
         $row = explode(' || ', trim($row, '| '));
         if (isset($row[2], $row[4]) && is_numeric($row[2])) {
             $currency = new Currency();
             $currency->setCode(sfConfig::get('app_currency_alias_' . $row[0], $row[0]));
             $currency->setNumber($row[1]);
             $currency->setDigits(ceil($row[2]));
             $currency->setName($row[3]);
             $currency->save();
         }
     }
 }
開發者ID:asaraf28,項目名稱:CurrencyConverter,代碼行數:18,代碼來源:getCurrenciesTask.class.php

示例3: getTotal

 /**
  * Total of order including postage
  *
  * @return Decimal
  */
 public function getTotal()
 {
     $return = new Currency();
     $return->setName("Total");
     $total = $this->getSubTotal()->RAW() + $this->getPostage()->RAW() - $this->DiscountAmount + $this->getTaxTotal()->RAW();
     $return->setValue($total);
     $this->extend("updateTotal", $return);
     return $return;
 }
開發者ID:i-lateral,項目名稱:silverstripe-orders,代碼行數:14,代碼來源:Order.php

示例4: Currency

 /**
  * Internal function to return a Currency object from a row.
  * @param $row array
  * @return Currency
  */
 function &_returnCurrencyFromRow($codeAlpha, &$entry)
 {
     $currency = new Currency();
     $currency->setCodeAlpha($codeAlpha);
     $currency->setName($entry[0]);
     $currency->setCodeNumeric($entry[1]);
     HookRegistry::call('CurrencyDAO::_returnCurrencyFromRow', array(&$currency, &$codeAlpha, &$entry));
     return $currency;
 }
開發者ID:anorton,項目名稱:pkp-lib,代碼行數:14,代碼來源:CurrencyDAO.inc.php

示例5: getAll2

 public function getAll2()
 {
     $currencies = array();
     foreach ($this->data as $currencyCode => $definition) {
         $fractionDigits = isset($definition['fraction_digits']) ?: 2;
         $currency = new Currency();
         $currency->setCurrencyCode($definition['code']);
         $currency->setName($definition['name']);
         $currency->setSymbol($definition['symbol']);
         $currency->setNumericCode($definition['numeric_code']);
         $currency->setFractionDigits($fractionDigits);
         $currencies[$currencyCode] = $currency;
     }
     return $currencies;
 }
開發者ID:bojanz,項目名稱:array-object-benchmark,代碼行數:15,代碼來源:Currency.php

示例6: dirname

<?php

include dirname(__FILE__) . '/bootstrap.php';
$con = Propel::getConnection();
$currencies = new SimpleXMLElement(file_get_contents(dirname(__FILE__) . '/iso4217_currencies.xml'));
$tbl = $currencies->CcyTbl;
$entries = $tbl->CcyNtry;
$done = [];
foreach ($entries as $entry) {
    if (isset($done[(string) $entry->Ccy])) {
        continue;
    }
    $minorUnit = (string) $entry->CcyMnrUnts;
    if (is_numeric($minorUnit)) {
        $minorUnit = intval($minorUnit);
    } else {
        $minorUnit = 0;
    }
    $currency = new Currency();
    $currency->setName((string) $entry->CcyNm)->setAlphabeticCode((string) $entry->Ccy)->setNumericCode((string) $entry->CcyNbr)->setMinorUnit($minorUnit)->save($con);
    $done[(string) $entry->Ccy] = true;
}
開發者ID:nikonehauser,項目名稱:ptclient,代碼行數:22,代碼來源:currencies2db.php


注:本文中的Currency::setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。