当前位置: 首页>>代码示例>>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;未经允许,请勿转载。