Skip to content

Commit

Permalink
MAGETWO-40057: Create Grid Table
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka committed Aug 7, 2015
1 parent fe60ed7 commit dc19322
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions app/code/Magento/Customer/Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

namespace Magento\Customer\Setup;

use Magento\Framework\Module\Setup\Migration;
use Magento\Customer\Model\Customer;
use Magento\Framework\Indexer\IndexerRegistry;
use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
Expand All @@ -21,16 +22,31 @@ class UpgradeData implements UpgradeDataInterface
*
* @var CustomerSetupFactory
*/
private $customerSetupFactory;
protected $customerSetupFactory;

/**
* @var IndexerRegistry
*/
protected $indexerRegistry;

/**
* @var \Magento\Eav\Model\Config
*/
protected $eavConfig;

/**
* Init
*
* @param CustomerSetupFactory $customerSetupFactory
* @param IndexerRegistry $indexerRegistry
* @param \Magento\Eav\Model\Config $eavConfig
*/
public function __construct(CustomerSetupFactory $customerSetupFactory)
{
public function __construct(
CustomerSetupFactory $customerSetupFactory,
IndexerRegistry $indexerRegistry,
\Magento\Eav\Model\Config $eavConfig
) {
$this->customerSetupFactory = $customerSetupFactory;
$this->indexerRegistry = $indexerRegistry;
$this->eavConfig = $eavConfig;
}

/**
Expand Down Expand Up @@ -171,6 +187,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
}
}

$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
$indexer->reindexAll();
$this->eavConfig->clear();

$setup->endSetup();
}
}

0 comments on commit dc19322

Please sign in to comment.