Share » Forums » Developer » Easier ways of getting an attribute...

Easier ways of getting an attribute from an object?

Easier ways of getting an attribute from an object?

Wednesday 14 July 2004 4:25:41 am - 3 replies

Modified on Thursday 26 August 2004 7:03:24 am by Paul Forsyth

Author Message

Paul Forsyth

Thursday 26 August 2004 7:03:46 am

Bumping this one up.

paul

Björn Dieding@xrow.de

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/

Paul Forsyth

Thursday 26 August 2004 8:01:02 am

Excellent, thanks!

paul

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu