I'm getting this error :

Notice: Object of class Magento\Store\Model\Group\Interceptor could not be converted to int in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3065

The responsible piece of code is somewhere in it

foreach ($stores as $store){
    $storeId = $store->getId();
    $storeCode = $store->getCode();
        $storeGroupId = $store->getStoreGroupId();
        $group = $this->groupFactory->create();
        if($storeGroupId !== null){
            $factoryStore = $this->storeFactory->create();


1 Answer 1


Actually It was just a dumb mistakes I was setting $group instead of $group->getId()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.