本文整理汇总了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();
}