Skip to content

Commit 70f1c93

Browse files
author
Mastiuhin Olexandr
committed
MAGETWO-95692: [2.3] Value of Customer Address Attribute is not shown in the Customers grid
1 parent da1a96c commit 70f1c93

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

app/code/Magento/Customer/Model/Indexer/Source.php

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Customer\Model\Indexer;
77

8+
use Magento\Customer\Model\ResourceModel\Customer\Indexer\CollectionFactory;
89
use Magento\Customer\Model\ResourceModel\Customer\Indexer\Collection;
910
use Magento\Framework\App\ResourceConnection\SourceProviderInterface;
1011
use Traversable;
@@ -25,35 +26,35 @@ class Source implements \IteratorAggregate, \Countable, SourceProviderInterface
2526
private $batchSize;
2627

2728
/**
28-
* @param \Magento\Customer\Model\ResourceModel\Customer\Indexer\CollectionFactory $collection
29+
* @param CollectionFactory $collectionFactory
2930
* @param int $batchSize
3031
*/
3132
public function __construct(
32-
\Magento\Customer\Model\ResourceModel\Customer\Indexer\CollectionFactory $collectionFactory,
33+
CollectionFactory $collectionFactory,
3334
$batchSize = 10000
3435
) {
3536
$this->customerCollection = $collectionFactory->create();
3637
$this->batchSize = $batchSize;
3738
}
3839

3940
/**
40-
* {@inheritdoc}
41+
* @inheritdoc
4142
*/
4243
public function getMainTable()
4344
{
4445
return $this->customerCollection->getMainTable();
4546
}
4647

4748
/**
48-
* {@inheritdoc}
49+
* @inheritdoc
4950
*/
5051
public function getIdFieldName()
5152
{
5253
return $this->customerCollection->getIdFieldName();
5354
}
5455

5556
/**
56-
* {@inheritdoc}
57+
* @inheritdoc
5758
*/
5859
public function addFieldToSelect($fieldName, $alias = null)
5960
{
@@ -62,15 +63,15 @@ public function addFieldToSelect($fieldName, $alias = null)
6263
}
6364

6465
/**
65-
* {@inheritdoc}
66+
* @inheritdoc
6667
*/
6768
public function getSelect()
6869
{
6970
return $this->customerCollection->getSelect();
7071
}
7172

7273
/**
73-
* {@inheritdoc}
74+
* @inheritdoc
7475
*/
7576
public function addFieldToFilter($attribute, $condition = null)
7677
{
@@ -79,7 +80,7 @@ public function addFieldToFilter($attribute, $condition = null)
7980
}
8081

8182
/**
82-
* @return int
83+
* @inheritdoc
8384
*/
8485
public function count()
8586
{
@@ -105,4 +106,28 @@ public function getIterator()
105106
$pageNumber++;
106107
} while ($pageNumber <= $lastPage);
107108
}
109+
110+
/**
111+
* Joins Attribute
112+
*
113+
* @param string $alias alias for the joined attribute
114+
* @param string|\Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
115+
* @param string $bind attribute of the main entity to link with joined $filter
116+
* @param string|null $filter primary key for the joined entity (entity_id default)
117+
* @param string $joinType inner|left
118+
* @param int|null $storeId
119+
* @return void
120+
* @throws \Magento\Framework\Exception\LocalizedException
121+
* @see Collection::joinAttribute()
122+
*/
123+
public function joinAttribute(
124+
string $alias,
125+
$attribute,
126+
string $bind,
127+
?string $filter = null,
128+
string $joinType = 'inner',
129+
?int $storeId = null
130+
): void {
131+
$this->customerCollection->joinAttribute($alias, $attribute, $bind, $filter, $joinType, $storeId);
132+
}
108133
}

0 commit comments

Comments
 (0)