/** * Standard resource collection initialization * Needed for child classes * * @param string $model * @param string $entityModel * @return $this */ protected function _init($model, $entityModel) { if ($this->isEnabledFlat()) { $entityModel = 'Magento\\Catalog\\Model\\ResourceModel\\Product\\Flat'; } return parent::_init($model, $entityModel); }