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

How to get product creation date ? 
 
PitchOu
Member
 
Total Posts:  39
Joined:  2008-02-04
Villeneuve d'Ascq, France
 

Hello !

I’d like to get the creation date for my products, but I didn’t find such a method.

Any idea ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

tried $product->getCreatedAt() ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
PitchOu
Member
 
Total Posts:  39
Joined:  2008-02-04
Villeneuve d'Ascq, France
 

It works, thanks a lot !

But where is this method declared ? Hum ... something related to php5 auto declared methods ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
salsasepp
Member
 
Avatar
Total Posts:  32
Joined:  2008-03-21
Saarlouis, Germany
 

Exactly right. Look into lib/Varien/Object.php, you will find the magic __call() method that implements set, get, uns (unset) and has. Seems like every class ultimately inherits from Varien_Object.
I was new to PHP and took me a few days to figure that one out… Magento is the best PHP tutorial I could find, short on commented code but rich in concepts and challenges wink

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