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


PHP ContactsUtil::resolveAddressesFromRelatedAccount方法代码示例

本文整理汇总了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);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:6,代码来源:DefaultController.php

示例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);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:38,代码来源:ContactsUtilTest.php


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