当前位置: 首页>>代码示例>>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;未经允许,请勿转载。