Skip to content

Commit

Permalink
Moving the method's logic into construct
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard13 committed Feb 20, 2019
1 parent a0be69b commit 9e657ad
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function __construct(
$this->addFieldStrategies = $addFieldStrategies;
$this->addFilterStrategies = $addFilterStrategies;
$this->modifiersPool = $modifiersPool ?: ObjectManager::getInstance()->get(PoolInterface::class);
$this->setDefaultStoreToCollection();
$this->getCollection()->setStoreId(Store::DEFAULT_STORE_ID);
}

/**
Expand Down Expand Up @@ -142,12 +142,4 @@ public function getMeta()

return $meta;
}

/**
* Filter the product collection by Default Store if no filter is applied
*/
private function setDefaultStoreToCollection()
{
$this->getCollection()->setStoreId(Store::DEFAULT_STORE_ID);
}
}

0 comments on commit 9e657ad

Please sign in to comment.