Reputation: 359
i'm not able to add a property in _data array() to EAV model (extended Product Model) when it is initialized, for example by a collection call (Mage::getResourceModel('catalog/product_collection')).
I try to extend _construct() with setValue(), but not work and here _data is empty!
When _data is filled?
When i have the product model with _data setted and i can manipulate this in initialization phase?
I don't want an attribute setted in db, because this attribute is dynamic.
thx for replies! :)
Upvotes: 0
Views: 273
Reputation: 618
What attributes are loaded and when are they loaded depends on where are you "standing" and whether or not you have the flat catalog enabled.
Generally speaking, to have an attribute loaded into a catalog/product_collection you need to specify it like this:
<?php
$collection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('my_custom_attribute')
Upvotes: 0