Friday 01 July 2005 2:12:38 pm - 5 replies
hi,
I'm looking for the code that allows you to make an array whith objects of a class.I just have the class id:305
I tried this, but it seems not to work fine:
$liste = eZContentObject::fetchList( true, array( 'contentclass_id' => 305 ) )
do someone have an other solution?
thx.
Friday 01 July 2005 6:42:02 pm
thanks harry,
but in my case, it seems not to work.
in the admin I have a 'prod' class, ID='305'
in this class there is 6 objects.
I want to put this 6 objects in an array.
First I tried:
$list=& eZContentClass::fetch( 305 );
After I tried your solution:
$liste=eZContentObject::fetchList( true, 'contentclass_id = 305' );
I receive more than 100 objects. why? I have empty the trash..
Help please..
Saturday 02 July 2005 10:20:12 am
Sunday 03 July 2005 4:16:36 am
I think you'll find the answers here http://pubsvn.ez.no/doxygen/classeZContentObject.html#a24 and here http://pubsvn.ez.no/doxygen/classeZPersistentObject.html#a9
$liste = eZContentObject::fetchList( true, array( 'contentclass_id' => 305 ) )
Should do the trick, however if you may need to add additional conditions. What you are after is all the CURRENT PUBLISHED objects of this class right?
$liste = eZContentObject::fetchList( true,
array( 'contentclass_id' => 305,
'status' => EZ_CONTENT_OBJECT_STATUS_PUBLISHED)
);
Should get you this.
Cheers
Bruce
Modified on Sunday 03 July 2005 4:28:24 am by Bruce Morrison
You must be logged in to post messages in this topic!