Share » Forums » Developer » eZContentObject::fetch

eZContentObject::fetch

eZContentObject::fetch

Wednesday 21 April 2004 3:28:09 am - 3 replies

Author Message

Paul Forsyth

Wednesday 21 April 2004 4:03:34 am

Thats a bit odd. Are you able to check the db and look at the objects values?

Did you create the object yourself?

paul

--
http://www.visionwt.com

Dominik Pich

Wednesday 21 April 2004 4:30:28 am

yes... I created them myself

in the db it seems correct !and! pages in the sitedesign folder not in a extension display the items just fine.

id of contentobject 139
id of its class 8 in ezcontentobject
name of its class "product"!? in ezcontentclass

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

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

36 542 Users on board!

Forums menu