Magento – Get new empty item on model method

moduleprogramming

Collections provide a handy means of getting a blank model – e.g.:

$quote->getItemsCollection()->getNewEmptyItem();

Is there any means of doing this from an existing model without having to call for the collection – in other words directly from the instance? Something like this:

$product = Mage::getModel('catalog/product')->load(43);
$productNew = $product->getNewEmptyItem();

I do realize I could call getCollection() on the product first – not sure if this has some overhead.

Edit:

Obviously $product = Mage::getModel('catalog/product'); produces the desired result. Obviously. What I'm looking for is a means of getting a blank object without reinstantiating the model.

Perhaps I just need to switch to using singletons to ease my mind.

Best Answer

You can use reset();

Mage::getModel('catalog/product')->load(1)->reset();

that calls _clearData, if you check in the Mage_Catalog_Model_Product you can see that this function resets all variables.