0

I'm following this guide :

http://www.mage-world.com/blog/how-to-use-model-and-collection-in-magento-2.html

But at the end i get the error

Fatal error: Class 'Magento\Framework\Model\Resource\Db\AbstractDb' not found in C:\wamp\www\eurecia-shop\app\code\Local\Providers\Model\Resource\providers.php on line 7

(I follow the tutorial, but i just change News by Providers, but it work the same)

this is my file where i get the error :

<?php
namespace Local\Providers\Model\Resource;
use Magento\Framework\Model\Resource\Db\AbstractDb;

class Providers extends AbstractDb

{
   /**
    * Define main table
    */
   protected function _construct()
   {
       $this->_init('local_providers', 'id');
    }
}

I search on google, and no result for this. I'm new to magento, so i'm not really familiar with it.

1 Answer 1

7

Change Magento\Framework\Model\Resource\Db\AbstractDb

to Magento\Framework\Model\ResourceModel\Db\AbstractDb

1
  • Yes, thanks, i find it also after more search, i find a facebook post where someone ask, and one good comment on it xD Apr 25, 2017 at 12:53

Your Answer

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

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