I want to modify the Downloadable Information / Links of a product programmability.
I am able to create a downloadable product. But I can't find how to edit the links.
I think the fonction setDownloadableData / getDownloadableData could help me.
But, i can't find them in the Magento source (1.7.0.2).
with
grep -r "setDownloadableData" magento/*
I can only see the call to the function. Not the implementation. ...
/magento/app/code/core/Mage/Downloadable/Model/Link/Api.php
$product->setDownloadableData($downloadable);
/magento/app/code/core/Mage/Downloadable/Model/Observer.php
$product->setDownloadableData($downloadable);
The answer is Varien Data Collections
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-8-varien-data-collections
You cannot find the methods because they don't exist.
Most of the classes in Magento extend Varian_Object
class that overloads the 'magic method' __call
. This is called when a method in the class does not exist.
To get a better view on this take a look at Varien_Object::__call()
, this article and what php.net has to say about overloading