當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。