Forums / Developer / Easier ways of getting an attribute from an object?
Paul Forsyth
Wednesday 14 July 2004 4:25:41 am
I may have missed something but it would be very nice to have easier ways of getting attribute objects from objects without needing to search for yourself.
At the moment i either iterate through the array the function contentObjectAttributes returns from eZContentObject, or if i can safely use the index of the array i access directly.
eZContentObjectAttribute has the function fetchByIdentifier but that doesnt seem to get a specific identifier from a single attribute, which would be nice.
A function in eZContentObject to fetchByAttributeIdentifier would be nice.
paul
Thursday 26 August 2004 7:03:46 am
Bumping this one up.
Björn [email protected]
Thursday 26 August 2004 7:13:13 am
# co has one contentobject attribute called name(identifier)$co = eZContentobejct::fetch($id);
$datamap =& $co->attribute('data_map');
$value = $datamap['name']->content(); or $value = $datamap['name']->attribute('data_text');
$datamap['name']->setAttribute('data_text', ' new value');
$datamap['name']->store();
did this help?
Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs Looking for hosting? http://hostingezpublish.com ----------------------------------------------------------------------------- GMT +01:00 Hannover, Germany Web: http://www.xrow.com/
Thursday 26 August 2004 8:01:02 am
Excellent, thanks!