當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Customer::getData方法代碼示例

本文整理匯總了PHP中Magento\Customer\Test\Fixture\Customer::getData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Customer::getData方法的具體用法?PHP Customer::getData怎麽用?PHP Customer::getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Customer\Test\Fixture\Customer的用法示例。


在下文中一共展示了Customer::getData方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepareVatConfig

 /**
  * Prepare VAT ID confguration.
  *
  * @param ConfigData $vatConfig
  * @param string $customerGroup
  * @return void
  */
 protected function prepareVatConfig(ConfigData $vatConfig, $customerGroup)
 {
     $groupConfig = ['customer/create_account/viv_domestic_group' => ['value' => $this->vatGroups['valid_domestic_group']->getCustomerGroupId()], 'customer/create_account/viv_intra_union_group' => ['value' => $this->vatGroups['valid_intra_union_group']->getCustomerGroupId()], 'customer/create_account/viv_invalid_group' => ['value' => $this->vatGroups['invalid_group']->getCustomerGroupId()], 'customer/create_account/viv_error_group' => ['value' => $this->vatGroups['error_group']->getCustomerGroupId()]];
     $vatConfig = $this->fixtureFactory->createByCode('configData', ['data' => array_replace_recursive($vatConfig->getSection(), $groupConfig)]);
     $vatConfig->persist();
     $customerData = array_merge($this->customer->getData(), ['group_id' => ['value' => $this->vatGroups[$customerGroup]->getCustomerGroupCode()]], ['address' => ['addresses' => $this->customer->getDataFieldConfig('address')['source']->getAddresses()]]);
     $this->customer = $this->fixtureFactory->createByCode('customer', ['data' => $customerData]);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:AbstractApplyVatIdTest.php

示例2: processAssert

 /**
  * Assert customer availability in Customer Grid
  *
  * @param Customer $customer
  * @param CustomerIndex $pageCustomerIndex
  * @param Customer $initialCustomer [optional]
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function processAssert(Customer $customer, CustomerIndex $pageCustomerIndex, Customer $initialCustomer = null)
 {
     if ($initialCustomer) {
         $customer = $customer->hasData() ? array_merge($initialCustomer->getData(), $customer->getData()) : $initialCustomer->getData();
     } else {
         $customer = $customer->getData();
     }
     $name = (isset($customer['prefix']) ? $customer['prefix'] . ' ' : '') . $customer['firstname'] . (isset($customer['middlename']) ? ' ' . $customer['middlename'] : '') . ' ' . $customer['lastname'] . (isset($customer['suffix']) ? ' ' . $customer['suffix'] : '');
     $filter = ['name' => $name, 'email' => $customer['email']];
     $pageCustomerIndex->open();
     \PHPUnit_Framework_Assert::assertTrue($pageCustomerIndex->getCustomerGridBlock()->isRowVisible($filter), 'Customer with ' . 'name \'' . $filter['name'] . '\', ' . 'email \'' . $filter['email'] . '\' ' . 'is absent in Customer grid.');
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:22,代碼來源:AssertCustomerInGrid.php

示例3: prepareCustomer

 /**
  * Prepares customer returned after test.
  *
  * @param Customer $customer
  * @param Customer $initialCustomer
  * @param Address|null $address
  * @param Address|null $addressToDelete
  * @return Customer
  */
 private function prepareCustomer(Customer $customer, Customer $initialCustomer, Address $address = null, Address $addressToDelete = null)
 {
     $data = $customer->hasData() ? array_replace_recursive($initialCustomer->getData(), $customer->getData()) : $initialCustomer->getData();
     $groupId = $customer->hasData('group_id') ? $customer : $initialCustomer;
     $data['group_id'] = ['customerGroup' => $groupId->getDataFieldConfig('group_id')['source']->getCustomerGroup()];
     if ($initialCustomer->hasData('address')) {
         $addressesList = $initialCustomer->getDataFieldConfig('address')['source']->getAddresses();
         foreach ($addressesList as $key => $addressFixture) {
             if ($addressToDelete === null || $addressFixture != $address) {
                 $data['address'] = ['addresses' => [$key => $addressFixture]];
             }
         }
     }
     if ($address !== null) {
         $data['address']['addresses'][] = $address;
     }
     return $this->fixtureFactory->createByCode('customer', ['data' => $data]);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:27,代碼來源:UpdateCustomerBackendEntityTest.php

示例4: prepareData

 /**
  * Prepare customer data for Web API.
  *
  * @param Customer $customer
  * @return array
  */
 protected function prepareData(Customer $customer)
 {
     $data['customer'] = $this->replaceMappingData($customer->getData());
     $data['customer']['group_id'] = $this->getCustomerGroup($customer);
     $data['password'] = $data['customer']['password'];
     unset($data['customer']['password']);
     unset($data['customer']['password_confirmation']);
     $data = $this->prepareAddressData($data);
     return $data;
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:16,代碼來源:Webapi.php

示例5: getValidationMessages

 /**
  * Get all error validation messages for fields.
  *
  * @param Customer $customer
  * @return array
  */
 public function getValidationMessages(Customer $customer)
 {
     $messages = [];
     foreach (array_keys($customer->getData()) as $field) {
         $element = $this->_rootElement->find(sprintf($this->validationText, str_replace('_', '-', $field)));
         if ($element->isVisible()) {
             $messages[$field] = $element->getText();
         }
     }
     return $messages;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:17,代碼來源:CustomerForm.php

示例6: processAssert

 /**
  * Assert that displayed customer data on edit page(backend) equals passed from fixture
  *
  * @param Customer $customer
  * @param CustomerIndex $pageCustomerIndex
  * @param CustomerIndexEdit $pageCustomerIndexEdit
  * @param Address $address[optional]
  * @param Customer $initialCustomer [optional]
  * @return void
  */
 public function processAssert(Customer $customer, CustomerIndex $pageCustomerIndex, CustomerIndexEdit $pageCustomerIndexEdit, Address $address = null, Customer $initialCustomer = null)
 {
     $data = [];
     $filter = [];
     if ($initialCustomer) {
         $data['customer'] = $customer->hasData() ? array_merge($initialCustomer->getData(), $customer->getData()) : $initialCustomer->getData();
     } else {
         $data['customer'] = $customer->getData();
     }
     if ($address) {
         $data['addresses'][1] = $address->hasData() ? $address->getData() : [];
     } else {
         $data['addresses'] = [];
     }
     $filter['email'] = $data['customer']['email'];
     $pageCustomerIndex->open();
     $pageCustomerIndex->getCustomerGridBlock()->searchAndOpen($filter);
     $dataForm = $pageCustomerIndexEdit->getCustomerForm()->getDataCustomer($customer, $address);
     $dataDiff = $this->verify($data, $dataForm);
     \PHPUnit_Framework_Assert::assertTrue(empty($dataDiff), 'Customer data on edit page(backend) not equals to passed from fixture.' . "\nFailed values: " . implode(', ', $dataDiff));
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:31,代碼來源:AssertCustomerForm.php

示例7: prepareCustomerData

 /**
  * Prepare customer data.
  *
  * @param array $data
  * @return array
  */
 protected function prepareCustomerData(array $data)
 {
     return ['currency_id' => $data['base_currency_code'], 'customer_id' => $this->customer->getData('id'), 'payment' => $data['payment_authorization_amount'], 'store_id' => $this->order->getDataFieldConfig('store_id')['source']->store->getStoreId()];
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:10,代碼來源:Curl.php

示例8: saveCustomer

 /**
  * Save new customer and get form key
  *
  * @param \Magento\Customer\Test\Fixture\Customer $fixture
  * @return CurlTransport
  */
 protected function saveCustomer(\Magento\Customer\Test\Fixture\Customer $fixture)
 {
     $data = $fixture->getData('fields');
     $fields = array();
     foreach ($data as $key => $field) {
         $fields[$key] = $field['value'];
     }
     $url = $_ENV['app_frontend_url'] . $this->saveCustomer;
     $curl = new CurlTransport();
     $curl->write(CurlInterface::POST, $url, '1.0', array(), $fields);
     $curl->read();
     $urlForm = $_ENV['app_frontend_url'] . $this->addressNew;
     $curl->write(CurlInterface::GET, $urlForm, '1.0', array());
     $response = $curl->read();
     $this->formKey = $this->getFromKey($response);
     return $curl;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:23,代碼來源:SaveCustomerWithAddress.php

示例9: prepareCustomer

 /**
  * Prepares customer returned after test.
  *
  * @param Customer $customer
  * @param Customer $initialCustomer
  * @return Customer
  */
 private function prepareCustomer(Customer $customer, Customer $initialCustomer)
 {
     if (!$customer->hasData()) {
         return $initialCustomer;
     }
     $data = array_replace_recursive($initialCustomer->getData(), $customer->getData());
     $data['group_id'] = ['customerGroup' => $initialCustomer->getDataFieldConfig('group_id')['source']->getCustomerGroup()];
     return $this->fixtureFactory->createByCode('customer', ['data' => $data]);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:16,代碼來源:UpdateCustomerFrontendEntityTest.php


注:本文中的Magento\Customer\Test\Fixture\Customer::getData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。