Forums / General / get value of an attribute (related Objects)

get value of an attribute (related Objects)

Author Message

Coulibaly Ibrahim

Monday 05 June 2006 11:55:58 pm

Hello,

i've two classes: Lecteur (lecteur_class) and Magazine(magazine_class)

Magazine class:
-name(Text line)
-date_sortie(Date)
-description(Text Bloc),

Lecteur class is define:
-fisrt_name(Text line)
-last_name(Text Line)
-....
-magazine(Related Objects va accept only type Magazine class)

an objects of class Lecteur can be "related" to 0,1 or more Magazines.

i now want to fetch all the magazine related to an object of class Lecteur

how can i do that???

thanks.

Xavier Dutoit

Tuesday 06 June 2006 12:05:26 am

Salut,

I'd suggest to try this attribute to strore the magazine into the reader, that's probably going to help you.

http://ez.no/community/contribs/datatypes/enhanced_objectrelation

You can then simply use the attribute_view_gui to display the list
No matter what, use this fetch:
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/related_objects
and this one to find the readers of a magazine.

http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/reverse_related_objects

T'es du burkina ?

X+

http://www.sydesy.com

Kristof Coomans

Tuesday 06 June 2006 12:06:27 am

Hi

You can use the related_objects fetch function ( http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/related_objects ). Set object_id to the id of your Lecteur object and attribute_identifier to the id of the lecteur/magazine class attribute.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Coulibaly Ibrahim

Tuesday 06 June 2006 1:34:49 am

thanks you two.

i've solve my problem with the two solution :)
(in fact, i'd to specify all_relations in order to have my object(s))

thanks Xavier, the Enhanced Object relation seems to be very great, i've understand it more. don't.

@Xavier: je suis de la Côte d'Ivoire. ;)