当前位置: 首页>>代码示例>>PHP>>正文


PHP Currency::makeBaseCurrency方法代码示例

本文整理汇总了PHP中Currency::makeBaseCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::makeBaseCurrency方法的具体用法?PHP Currency::makeBaseCurrency怎么用?PHP Currency::makeBaseCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Currency的用法示例。


在下文中一共展示了Currency::makeBaseCurrency方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = User::getByUsername('super');
     $bobby = UserTestHelper::createBasicUser('bobby');
     $sarah = UserTestHelper::createBasicUser('sarah');
     self::$superUserId = $super->id;
     self::$bobbyUserId = $bobby->id;
     self::$sarahUserId = $sarah->id;
     $currency = Currency::makeBaseCurrency();
     assert($currency->code == 'USD');
     // Not Coding Standard
     self::$baseCurrencyId = $currency->id;
     $currency = new Currency();
     $currency->code = 'EUR';
     $currency->rateToBase = 2;
     assert($currency->save());
     // Not Coding Standard
     self::$eurCurrencyId = $currency->id;
     $values = array('A1', 'B2', 'C3', 'D4', 'E5', 'F6');
     $fieldData = CustomFieldData::getByName('WorkflowTestDropDown');
     $fieldData->serializedData = serialize($values);
     $saved = $fieldData->save();
     assert($saved);
     // Not Coding Standard
     $values = array('A1', 'B2', 'C3', 'D4', 'E5', 'F6');
     $fieldData = CustomFieldData::getByName('WorkflowTestRadioDropDown');
     $fieldData->serializedData = serialize($values);
     $saved = $fieldData->save();
     assert($saved);
     // Not Coding Standard
     $values = array('M1', 'M2', 'M3', 'M4', 'M5', 'M6');
     $fieldData = CustomFieldData::getByName('WorkflowTestMultiDropDown');
     $fieldData->serializedData = serialize($values);
     $saved = $fieldData->save();
     assert($saved);
     // Not Coding Standard
     $values = array('M1', 'M2', 'M3', 'M4', 'M5', 'M6');
     $fieldData = CustomFieldData::getByName('WorkflowTestTagCloud');
     $fieldData->serializedData = serialize($values);
     $saved = $fieldData->save();
     assert($saved);
     // Not Coding Standard
     $loaded = ContactsModule::loadStartingData();
     assert($loaded);
     // Not Coding Standard
     $contactStates = ContactState::getByName('New');
     self::$newState = $contactStates[0];
     $contactStates = ContactState::getByName('In progress');
     self::$inProgressState = $contactStates[0];
     self::$groupTest = new Group();
     self::$groupTest->name = 'test';
     $saved = self::$groupTest->save();
     assert($saved);
     // Not Coding Standard
     $group = Group::getByName(Group::EVERYONE_GROUP_NAME);
     $saved = $group->save();
     assert($saved);
     // Not Coding Standard
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:60,代码来源:WorkflowActionAttributeFormResolveValueTest.php

示例2: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     Currency::makeBaseCurrency();
     //Create a Product Template for testing.
     ProductTemplateTestHelper::createProductTemplateByName('superProductTemplate', $super);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:ProductTemplatesDesignerSuperUserWalkthroughTest.php

示例3: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     Currency::makeBaseCurrency();
     //create a lead here
     LeadTestHelper::createLeadbyNameForOwner('superLead', $super);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:LeadsDesignerSuperUserWalkthroughTest.php

示例4: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     Currency::makeBaseCurrency();
     //Create a account for testing
     $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:AccountsSuperUserCustomDateNullValueBugWalkthroughTest.php

示例5: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     Currency::makeBaseCurrency();
     //Setup test data owned by the super user.
     self::$account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
     self::$account2 = AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:11,代码来源:AccountAccountAffiliationsDesignerSuperUserWalkthroughTest.php

示例6: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     Currency::makeBaseCurrency();
     //Create a account for testing.
     $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
     //Create a opportunity for testing.
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp', $super, $account);
     //Create a two contacts for testing.
     ContactTestHelper::createContactWithAccountByNameForOwner('superContact1', $super, $account);
     ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account);
     //Create a note for testing.
     NoteTestHelper::createNoteWithOwnerAndRelatedAccount('superNote', $super, $account);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:17,代码来源:NotesDesignerSuperUserWalkthroughTest.php

示例7: getActiveCurrencyForCurrentUser

 /**
  * Resolve the active currency for the current user.  If the user does not have a currency, it will fall back
  * to the base system currency.  If the base system currency does not exist, it will attempt to make it.
  * @throws NotSupportedException
  */
 public function getActiveCurrencyForCurrentUser()
 {
     if (Yii::app()->user->userModel->currency->id > 0) {
         return Yii::app()->user->userModel->currency;
     }
     try {
         $code = $this->getBaseCode();
         if (null != ($currency = Currency::getCachedCurrencyByCode($code))) {
             return $currency;
         }
         $currency = Currency::getByCode($code);
     } catch (NotFoundException $e) {
         $currency = Currency::makeBaseCurrency();
     }
     if ($currency->id <= 0) {
         throw new NotSupportedException();
     }
     Currency::setCachedCurrency($currency);
     return $currency;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:25,代码来源:ZurmoCurrencyHelper.php


注:本文中的Currency::makeBaseCurrency方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。