Forums / Setup & design / Data retrieval (edited) - Second Try

Data retrieval (edited) - Second Try

Author Message

Daniel Guerrier

Monday 22 August 2005 4:49:46 pm

Can someone give me a quick explanation of how data retrieval works using the ez framework.

I have a content class called myfile with a textfield named title and a file attribute name file.
I have two instances of this content class with node ids of 120 and 121.

When I use this code to fetch all instances I end up with a node id of 512. How do I retrieve the actual content class instances and access the data in the attributes?

$class =& eZContentClass::fetchByIdentifier('myfile');
if(is_object($class))
{
	$objects =& eZContentObject::fetchSameClassList($class->attribute( 'id' ));
	echo($objects[0]->attribute('id'));
}

I was under the assumption that ClassList fetch returned the individual content class instances.