Share » Forums » Developer » Fetching related objects of a...

Fetching related objects of a specific class

Fetching related objects of a specific class

Friday 11 November 2005 11:43:32 am - 1 reply

Author Message

Clemens T

Friday 11 November 2005 4:57:07 pm

I'd say just loop the related-objects array and create a new array and fill it with the object you want:

(pseudo code)

$myFilteredRelatedObject=array();
foreach($relatedObjects as $related)
{
      if($related->attribute('class_identifier')=='my_class_id')
      {
             $myFilteredRelatedObject[]=$related;
      }
}//$myFilteredRelatedObject contains the filtered objects.

off course this is pseudo code, but something like this should work (and yes.. I know that your approch is 'cleaner'.. but don't have any ez code here.. so can't check the ez classes.. that's why my answer is probably incomplete).

Good luck!
Clemens

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

36 542 Users on board!

Forums menu