Friday 11 November 2005 11:43:32 am
I have user groups related to a product and want to retieve only the user groups related to that product (instead of all of the related content objects.) So far I can retieve all of the user groups in the system...
$userGroupClass =& eZContentClass::fetchByIdentifier('user_group');
$conditions = array('contentclass_id' => $userGroupClass->attribute('id'));
$groupObjects =& eZContentObject::fetchList(true, $conditions);
...and I know how to get all of the objects related to the product...
$productObject =& eZContentObject->fetch($myProductId);
$relatedObjects =& $productObject->relatedContentObjectArray();
...but I don't know how to get only the user groups related to the product. Is there an intuitive way to do this, or will I have to take one of the above approaches and loop over the results to pick out the objects I want?
|