本文整理匯總了PHP中ContactsUtil::resolveAddressesFromRelatedAccount方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContactsUtil::resolveAddressesFromRelatedAccount方法的具體用法?PHP ContactsUtil::resolveAddressesFromRelatedAccount怎麽用?PHP ContactsUtil::resolveAddressesFromRelatedAccount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContactsUtil
的用法示例。
在下文中一共展示了ContactsUtil::resolveAddressesFromRelatedAccount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionCreateFromRelation
public function actionCreateFromRelation($relationAttributeName, $relationModelId, $relationModuleId, $redirectUrl)
{
$contact = $this->resolveNewModelByRelationInformation(new Contact(), $relationAttributeName, (int) $relationModelId, $relationModuleId);
ContactsUtil::resolveAddressesFromRelatedAccount($contact);
$this->actionCreateByModel($contact, $redirectUrl);
}
示例2: testResolveAddressesFromRelatedAccount
/**
* @depends testGetContactStateDataFromStartingStateKeyedByIdAndLabelByLanguage
*/
public function testResolveAddressesFromRelatedAccount()
{
Yii::app()->user->userModel = User::getByUsername('super');
$contact = new Contact();
$account = new Account();
$account->name = 'some name';
$account->billingAddress->city = 'some city';
$account->billingAddress->country = 'some country';
$account->billingAddress->postalCode = 'some postalCode';
$account->billingAddress->state = 'some state';
$account->billingAddress->street1 = 'some street1';
$account->billingAddress->street2 = 'some street2';
$account->shippingAddress->city = 'some2 city';
$account->shippingAddress->country = 'some2 country';
$account->shippingAddress->postalCode = 'some2 postalCode';
$account->shippingAddress->state = 'some2 state';
$account->shippingAddress->street1 = 'some2 street1';
$account->shippingAddress->street2 = 'some2 street2';
$saved = $account->save();
$this->assertTrue($saved);
$contact->account = $account;
ContactsUtil::resolveAddressesFromRelatedAccount($contact);
$this->assertEquals('some city', $contact->primaryAddress->city);
$this->assertEquals('some country', $contact->primaryAddress->country);
$this->assertEquals('some postalCode', $contact->primaryAddress->postalCode);
$this->assertEquals('some state', $contact->primaryAddress->state);
$this->assertEquals('some street1', $contact->primaryAddress->street1);
$this->assertEquals('some street2', $contact->primaryAddress->street2);
$this->assertEquals('some2 city', $contact->secondaryAddress->city);
$this->assertEquals('some2 country', $contact->secondaryAddress->country);
$this->assertEquals('some2 postalCode', $contact->secondaryAddress->postalCode);
$this->assertEquals('some2 state', $contact->secondaryAddress->state);
$this->assertEquals('some2 street1', $contact->secondaryAddress->street1);
$this->assertEquals('some2 street2', $contact->secondaryAddress->street2);
}