D
D
Denis99992017-09-05 21:20:08
Magento
Denis9999, 2017-09-05 21:20:08

Magento and resource file path?

The class contains the correct path to the file, but the following error pops up:
Fatal error: Class 'My_Articles_Model_Resource_Setup' not found in C:\xampp\htdocs\magento3.dev\app\code\core\Mage\Core\Model\Resource\Setup. php
Why is this file being looked for in the core folder and not local?
config.xml:

<?xml version="1.0" ?>
<config>
    <modules>
        <My_Articles>
            <version>1.0.0</version>
        </My_Articles>
    </modules>

    <frontend>
        <routers>
            <marticles>
                <use>standard</use>
                <args>
                    <module>My_Articles</module>
                    <frontName>articles</frontName>
                </args>
            </marticles>
        </routers>
    </frontend>
    <global>


        <resources>
            <Articles_setup>
                <setup>
                    <module>My_Articles</module>
                    <class>My_Articles_Model_Resource_Setup</class>
                </setup>
            </Articles_setup>
        </resources>
    </global>

</config>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Batishchev, 2017-10-28
@z0rg

You didn't declare a resource for the model, it should be in global->models

...
    <global>
        <models>
            <myarticles>
                <class>My_Articles_Model</class>
                <resourceModel>myarticles_resource</resourceModel>
            </myarticles>
            <myarticles_resource>
                <class>My_Articles_Model_Resource</class>
                <entities>
                    <article>
                        <table>myarticles</table>
                    </article>
                </entities>
            </myarticles_resource>
         </models>
         ...
     </global>

And setup for migrations and initial installation requires a separate article for explanation, search the internet for a full description.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question