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


PHP Currency::getCount方法代碼示例

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


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

示例1: testLoad

 public function testLoad()
 {
     $customFieldData = CustomFieldData::getByName('Titles');
     $this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('AccountTypes');
     $this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('LeadSources');
     $this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('Industries');
     $this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('MeetingCategories');
     $this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
     $this->assertEquals(0, ContactState::getCount());
     // do a getAll to ensure we create base currency
     $baseCurrency = Currency::getAll();
     $this->assertCount(1, $baseCurrency);
     $this->assertEquals(1, Currency::getCount());
     $messageLogger = new MessageLogger();
     DefaultDataUtil::load($messageLogger);
     $customFieldData = CustomFieldData::getByName('Titles');
     $this->assertEquals(4, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('AccountTypes');
     $this->assertEquals(3, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('LeadSources');
     $this->assertEquals(4, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('Industries');
     $this->assertEquals(9, count(unserialize($customFieldData->serializedData)));
     $customFieldData = CustomFieldData::getByName('MeetingCategories');
     $this->assertEquals(2, count(unserialize($customFieldData->serializedData)));
     $this->assertEquals(6, ContactState::getCount());
     $this->assertEquals(1, Currency::getCount());
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:32,代碼來源:DefaultDataUtilTest.php

示例2: testGetAllMakesBaseCurrency

 public function testGetAllMakesBaseCurrency()
 {
     $this->assertEquals(0, count(Currency::getAll(null, false, null, false)));
     $currency = Yii::app()->currencyHelper;
     $this->assertEquals('USD', $currency->getBaseCode());
     $this->assertEquals(0, Currency::getCount());
     $this->assertEquals(1, count(Currency::getAll()));
     $this->assertEquals(1, Currency::getCount());
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:9,代碼來源:CurrencyTest.php

示例3: testGetAllMakesBaseCurrency

 public function testGetAllMakesBaseCurrency()
 {
     $this->assertEquals(0, count(Currency::getAll(null, false, null, false)));
     $currency = Yii::app()->currencyHelper;
     $this->assertEquals('USD', $currency->getBaseCode());
     $this->assertEquals(0, Currency::getCount());
     // do a getAll to ensure we create base currency
     $baseCurrency = Currency::getAll();
     $this->assertCount(1, $baseCurrency);
     $this->assertEquals(1, Currency::getCount());
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:11,代碼來源:CurrencyTest.php

示例4: _new

 public function _new()
 {
     $flash = Flash::Instance();
     $errors = array();
     $currency = new Currency();
     if ($currency->getCount() == 0) {
         $errors[] = 'No Currencies defined';
     }
     if (count($errors) > 0) {
         $flash->addErrors($errors);
         sendback();
     }
     parent::_new();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:14,代碼來源:CurrencyratesController.php

示例5: testGetAndSetCurrencyValue

 public function testGetAndSetCurrencyValue()
 {
     $currencyHelper = Yii::app()->currencyHelper;
     $this->assertEquals('USD', $currencyHelper->getBaseCode());
     $this->assertEquals(0, Currency::getCount());
     // do a getAll to ensure we create base currency
     $baseCurrency = Currency::getAll();
     $this->assertCount(1, $baseCurrency);
     $this->assertEquals(1, Currency::getCount());
     //create a currency value and confirm the rateToBase populates correctly.
     $opportunity = new Opportunity();
     $opportunity->name = 'Tyfe';
     $opportunity->stage->value = 'Starting Up';
     $opportunity->closeDate = '2008-10-05';
     $opportunity->amount->value = 456.78;
     //Setting the amount currency should not increase the currency table with a blank currency.
     $this->assertEquals(1, Currency::getCount());
     $opportunity->amount->currency = Currency::getByCode('USD');
     $this->assertEquals(1, Currency::getCount());
     $this->assertTrue($opportunity->save());
     $this->assertEquals(1, $opportunity->amount->rateToBase);
     $this->assertEquals(Currency::getByCode('USD'), $opportunity->amount->currency);
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:23,代碼來源:CurrencyValueTest.php


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