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


PHP Customer::getResource方法代碼示例

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


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

示例1: __construct

 /**
  * @param \Magento\Framework\Stdlib\StringUtils $string
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\ImportExport\Model\ImportFactory $importFactory
  * @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
  * @param \Magento\Framework\App\ResourceConnection $resource
  * @param ProcessingErrorAggregatorInterface $errorAggregator
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param \Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\StorageFactory $storageFactory
  * @param \Magento\Customer\Model\ResourceModel\Attribute\CollectionFactory $attrCollectionFactory
  * @param \Magento\Customer\Model\CustomerFactory $customerFactory
  * @param array $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\Stdlib\StringUtils $string, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\App\ResourceConnection $resource, ProcessingErrorAggregatorInterface $errorAggregator, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\Eav\Model\Config $eavConfig, \Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\StorageFactory $storageFactory, \Magento\Customer\Model\ResourceModel\Attribute\CollectionFactory $attrCollectionFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, array $data = [])
 {
     $this->_resourceHelper = $resourceHelper;
     if (isset($data['attribute_collection'])) {
         $this->_attributeCollection = $data['attribute_collection'];
         unset($data['attribute_collection']);
     } else {
         $this->_attributeCollection = $attrCollectionFactory->create();
         $this->_attributeCollection->addSystemHiddenFilterWithPasswordHash();
         $data['attribute_collection'] = $this->_attributeCollection;
     }
     parent::__construct($string, $scopeConfig, $importFactory, $resourceHelper, $resource, $errorAggregator, $storeManager, $collectionFactory, $eavConfig, $storageFactory, $data);
     $this->_specialAttributes[] = self::COLUMN_WEBSITE;
     $this->_specialAttributes[] = self::COLUMN_STORE;
     $this->_permanentAttributes[] = self::COLUMN_EMAIL;
     $this->_permanentAttributes[] = self::COLUMN_WEBSITE;
     $this->_indexValueAttributes[] = 'group_id';
     $this->addMessageTemplate(self::ERROR_DUPLICATE_EMAIL_SITE, __('This email is found more than once in the import file.'));
     $this->addMessageTemplate(self::ERROR_ROW_IS_ORPHAN, __('Orphan rows that will be skipped due default row errors'));
     $this->addMessageTemplate(self::ERROR_INVALID_STORE, __('Invalid value in Store column (store does not exists?)'));
     $this->addMessageTemplate(self::ERROR_EMAIL_SITE_NOT_FOUND, __('We can\'t find that email and website combination.'));
     $this->addMessageTemplate(self::ERROR_PASSWORD_LENGTH, __('Please enter a password with a valid length.'));
     $this->_initStores(true)->_initAttributes();
     $this->_customerModel = $customerFactory->create();
     /** @var $customerResource \Magento\Customer\Model\ResourceModel\Customer */
     $customerResource = $this->_customerModel->getResource();
     $this->_entityTable = $customerResource->getEntityTable();
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:44,代碼來源:Customer.php


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