Forums / Developer / eZContentObject::fetch / Comment40400
Dominik Pich
Wednesday 21 April 2004 5:30:14 am
//assemble a list of contentObjects the user bought $boughtObjects = array(); $boughtIds =& mysql_findproducts(); foreach( $boughtIds as $id ) { //eZDebug::writeDebug( 'user bought object with id ' . $id ); $object =& eZContentObject::fetch( $id ); $boughtObjects[ count( $boughtObjects ) ] = $object; } foreach( $boughtObjects as $object ) { $contentClass = $object->attribute( "content_class" ); eZDebug::writeDebug( 'user bought object with name ' . $object->attribute( "name" ) . ' of type ' . $object->attribute( "class_name" ) . ' which equals ' . $contentClass->attribute( "name" ) ); }
Outputs:user bought object with name 01-00012-001: Am Zuckerhut of type which equals Product