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