Boilerplate Resource Model Class (Before CE 1.6 / EE 1.11)

Updated . Posted . Visible to the public.
/**
 * Yourcompany.com
 *
 * PHP Version 5
 *
 * @category  Namespace
 * @package   Namespace_Module
 * @author    Your Name <your.name@yourcompany.com>
 * @copyright 2012 yourcompany.com
 * @license   http://www.yourcompany.com/license.txt Your license
 * @link      N/A
 */

/**
 * Something resource model
 *
 * @category Namespace
 * @package  Namespace_Module
 * @author   Your Name <your.name@yourcompany.com>
 * @license  http://www.yourcompany.com/license.txt Your license
 * @link     N/A
 */
class Namespace_Module_Model_Mysql4_Something extends Mage_Core_Model_Mysql4_Abstract
{
    /**
     * Link domain model and set primary key
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init(
            'namespace_module/something', # model class name
            'entity_id'                   # table primary key
        );
    }
}

Mike Whitby
Last edit
Posted by Mike Whitby to Magento (2012-11-28 15:05)