Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problem in using model in my own module
 
angeloo
Jr. Member
 
Total Posts:  5
Joined:  2008-08-07
Lausanne - Switzerland
 

Hello everybody.

I try to create a new module.

I used moduleCreator to create my module with this structure:

app
-code
--local
---Angelo
----ProductPdf

I need to use a model defined in : app/code/local/Angelo/ProductPdf/Model/ProductPdf.php

I try with this line:

$pdf Mage::getModel('Angelo_ProductPdf/productPdf')->getPdf(array($productpdf));

getPdf is a fucntion defined in my model file.

But i got an error:

Warning: include(Mage/ProductPdf/Model/ProductPdf.php)

Why “Mage” and not “Angelo”?

My config file is this one:

<models>
            <
productpdf>
                <class>
Angelo_ProductPdf_Model</class>
                <
resourceModel>productpdf_mysql4</resourceModel>
            </
productpdf>
            <
productpdf_mysql4>
                <class>
Angelo_ProductPdf_Model_Mysql4</class>
                <
entities>
                    <
productpdf>
                        <
table>productpdf</table>
                    </
productpdf>
                </
entities>
            </
productpdf_mysql4>
        </
models>

Thanks in advance

Regards

Angelo

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedev
Sr. Member
 
Avatar
Total Posts:  117
Joined:  2009-06-01
 

In your case you should probably use

$pdf Mage::getModel('productpdf/productPdf')->getPdf(array($productpdf));
 
Magento Community Magento Community
Magento Community
Magento Community
 
angeloo
Jr. Member
 
Total Posts:  5
Joined:  2008-08-07
Lausanne - Switzerland
 

Thanks for your reply,

but if i put:

$pdf Mage::getModel('productPdf/productPdf')->getPdf(array($productpdf));

I get this error:

Warning: include(Mage/ProductPdf/Model/ProductPdf.php)

 
Magento Community Magento Community
Magento Community
Magento Community
 
demonkoryu
Guru
 
Avatar
Total Posts:  328
Joined:  2008-11-26
Dortmund, Germany
 
angelo2012 - 07 June 2009 08:53 PM

$pdf = Mage::getModel(’productpdf/productPdf’)->getPdf(array($productpdf));

 
Magento Community Magento Community
Magento Community
Magento Community
 
angeloo
Jr. Member
 
Total Posts:  5
Joined:  2008-08-07
Lausanne - Switzerland
 

Hello,

I found solution, in fact there was a mistake in config file

Thanks everyone

Angelo

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top