Forums / Developer / How to get value of the selection datatype

How to get value of the selection datatype

Author Message

justin kazadi

Friday 29 May 2009 8:06:12 am

Hello,

I want to kown how can i get the value of an attribute of the datatype selection by programmation?

$v=eZContentObjectTreeNode::subTreeByNodeID(
        array(  'ClassFilterType' => 'include',
                'ClassFilterArray' => array('newsletter'),// identifiant of the content classe
                'Depth' => 1,
                'DepthOperator' => 'eq'),
       233//node_id of the  parent
);


foreach ( $v as $o )
{

 $dataMap =& $o->dataMap();
        $nom =& $dataMap['country']->content();
               
	      echo $nom;
	      

}

the attribute name "nom" have the datatype "selection ".

i try with the function content() but i have like the result "array"

thanks in advance.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Luis Micunco

Wednesday 05 August 2009 3:48:36 am

Take a look at "ezselectiontype.php"
in .../kernel/classes/datatypes/ezselection/

There should be a function which gets the options and current value.

Lazaro Ferreira

Wednesday 05 August 2009 10:44:25 am

Hi,

You can always make a

vardump( $dataMap['country'] );

or

vardump( $nom );

, and look into the object/array structure

Lazaro
http://www.mzbusiness.com