Вопрос

getScope() method generates:

Fatal error: Uncaught Error: Call to undefined method Magento\Framework\App\Config::getScope()

public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager,
    \Magento\Framework\App\Config\ScopeConfigInterface $scope
) {
    $this->objectManager = $objectManager;
    $this->scope         = $scope;
    $this->entities      = $this->scope
        ->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT)
        ->getValue('oei/export_entities');
}
Это было полезно?

Решение

Delete getScope method will solve the problem.

public function __construct(
\Magento\Framework\ObjectManagerInterface $objectManager,
\Magento\Framework\App\Config\ScopeConfigInterface $scope
) {
$this->objectManager = $objectManager;
$this->scope         = $scope;
$this->entities      = $this->scope
    //->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT)
    ->getValue('oei/export_entities');
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top