magento Model Create an empty model

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

To create a new model in your module Add a folder Model in your module root folder and create a file Modelname.php in this folder. for example Rick/Demo/Model/Modelname.php

The class name of your model does matter call it like this:

<?php
class Rick_Demo_Model_Modelname {

}

make sure your model is defined in your config.xml in the etc folder of your module

Here an example:

2.0.4 Rick_Demo_Model

To load your module use the following code:

Mage::getModel('customemodelname/modelname')


Got any magento Question?