I have a custom module with a few tables. I have the model, resource model and collection classes in place. If I try to access the contents of the table, I am getting this error
Type Error occurred when creating object: Vendor\ModuleModel\ResourceModel\AddressGroups\Collection\Interceptor, Argument 5 passed to Vendor\Module\Model\ResourceModel\AddressGroups\Collection\Interceptor::__construct() must implement interface Magento\Framework\DB\Adapter\AdapterInterface or be null, string given, called in /home/user/magentoTest/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121
I'm getting this error only in production mode. If I switch to developer mode, everything seems to be working fine.
This is my collection.php
<?php
namespace Vendor\Module\Model\ResourceModel\AddressGroups;
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection{
public function _construct(){
$this->_init('Vendor\Module\Model\AddressGroups', 'Vendor\Module\Model\ResourceModel\AddressGroups');
}
}