本文整理汇总了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
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}