Exemple #1
0
 /**
  * Get shared items collection count
  *
  * @return int
  */
 public function getSharedCount()
 {
     /** @var $collection \Magento\Customer\Model\Resource\Customer\Collection */
     $collection = $this->_customerResFactory->create();
     $countSelect = $collection->getSelectCountSql();
     $countSelect->joinLeft(['wt' => $this->getWishlistTable()], 'wt.customer_id = e.entity_id', [])->where('wt.shared > 0')->group('wt.wishlist_id');
     return $countSelect->getAdapter()->fetchOne($countSelect);
 }
Exemple #2
0
 /**
  * Constructor
  *
  * @param string $name
  * @param string $primaryFieldName
  * @param string $requestFieldName
  * @param EavValidationRules $eavValidationRules
  * @param CustomerCollectionFactory $customerCollectionFactory
  * @param Config $eavConfig
  * @param FilterPool $filterPool
  * @param array $meta
  * @param array $data
  */
 public function __construct($name, $primaryFieldName, $requestFieldName, EavValidationRules $eavValidationRules, CustomerCollectionFactory $customerCollectionFactory, Config $eavConfig, FilterPool $filterPool, array $meta = [], array $data = [])
 {
     parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
     $this->eavValidationRules = $eavValidationRules;
     $this->collection = $customerCollectionFactory->create();
     $this->collection->addAttributeToSelect('*');
     $this->eavConfig = $eavConfig;
     $this->filterPool = $filterPool;
     $this->meta['customer']['fields'] = $this->getAttributesMeta($this->eavConfig->getEntityType('customer'));
     $this->meta['address']['fields'] = $this->getAttributesMeta($this->eavConfig->getEntityType('customer_address'));
 }
Exemple #3
0
 /**
  * Constructor
  *
  * @param string $primaryFieldName
  * @param string $requestFieldName
  * @param EavValidationRul $eavValidationRul
  * @param CustomerCollectionFactory $customerCollectionFactory
  * @param Config $eavConfig
  * @param array $meta
  * @param array $data
  */
 public function __construct($primaryFieldName, $requestFieldName, EavValidationRul $eavValidationRul, CustomerCollectionFactory $customerCollectionFactory, Config $eavConfig, array $meta = [], array $data = [])
 {
     $this->primaryFieldName = $primaryFieldName;
     $this->requestFieldName = $requestFieldName;
     $this->eavValidationRul = $eavValidationRul;
     $this->collection = $customerCollectionFactory->create();
     $this->collection->addAttributeToSelect('*');
     $this->eavConfig = $eavConfig;
     $this->meta = $meta;
     $this->meta['customer']['fields'] = $this->getAttributesMeta($this->eavConfig->getEntityType('customer'));
     $this->meta['address']['fields'] = $this->getAttributesMeta($this->eavConfig->getEntityType('customer_address'));
     $this->data = $data;
 }
Exemple #4
0
 /**
  * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $collectionFactory
  * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $colIteratorFactory
  * @param array $data
  */
 public function __construct(\Magento\Customer\Model\Resource\Customer\CollectionFactory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $colIteratorFactory, array $data = [])
 {
     $this->_customerCollection = isset($data['customer_collection']) ? $data['customer_collection'] : $collectionFactory->create();
     $this->_pageSize = isset($data['page_size']) ? $data['page_size'] : 0;
     $this->_byPagesIterator = isset($data['collection_by_pages_iterator']) ? $data['collection_by_pages_iterator'] : $colIteratorFactory->create();
 }
Exemple #5
0
 /**
  * @return \Magento\Customer\Model\Resource\Customer\Collection
  */
 protected function _createCustomersCollection()
 {
     return $this->_customersFactory->create();
 }
Exemple #6
0
 /**
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory
  * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory
  * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerColFactory
  * @param \Magento\CustomerImportExport\Model\Export\CustomerFactory $eavCustomerFactory
  * @param \Magento\Customer\Model\Resource\Address\CollectionFactory $addressColFactory
  * @param array $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerColFactory, \Magento\CustomerImportExport\Model\Export\CustomerFactory $eavCustomerFactory, \Magento\Customer\Model\Resource\Address\CollectionFactory $addressColFactory, array $data = [])
 {
     parent::__construct($scopeConfig, $storeManager, $collectionFactory, $resourceColFactory, $localeDate, $eavConfig, $data);
     $this->_customerCollection = isset($data['customer_collection']) ? $data['customer_collection'] : $customerColFactory->create();
     $this->_customerEntity = isset($data['customer_entity']) ? $data['customer_entity'] : $eavCustomerFactory->create();
     $this->_addressCollection = isset($data['address_collection']) ? $data['address_collection'] : $addressColFactory->create();
     $this->_initWebsites(true);
     $this->setFileName($this->getEntityTypeCode());
 }
Exemple #7
0
 /**
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory
  * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory
  * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerColFactory
  * @param array $data
  */
 public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerColFactory, array $data = array())
 {
     parent::__construct($scopeConfig, $storeManager, $collectionFactory, $resourceColFactory, $localeDate, $eavConfig, $data);
     $this->_customerCollection = isset($data['customer_collection']) ? $data['customer_collection'] : $customerColFactory->create();
     $this->_initAttributeValues()->_initStores()->_initWebsites(true);
 }