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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:01:52
Script start
Timing: Jan 18 2025 11:01:52
Module start 'layout'
Timing: Jan 18 2025 11:01:52
Module start 'content'
Timing: Jan 18 2025 11:01:52
Module end 'content'
Timing: Jan 18 2025 11:01:52
Script end

Main resources:

Total runtime0.9264 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.1797152.6406
Module start 'layout' 0.00680.0052 741.820339.4766
Module start 'content' 0.01190.9132 781.2969566.0547
Module end 'content' 0.92510.0012 1,347.351612.1250
Script end 0.9264  1,359.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4410160.0003
Check MTime0.00140.1460160.0001
Mysql Total
Database connection0.00070.074610.0007
Mysqli_queries0.874094.3486590.0148
Looping result0.00090.1012570.0000
Template Total0.880895.120.4404
Template load0.00320.343320.0016
Template processing0.877794.737420.4388
Template load and register function0.00010.009110.0001
states
state_id_array0.00090.100010.0009
state_identifier_array0.00210.230920.0011
Override
Cache load0.00290.3086210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.059730.0002
Fetch class attribute name0.00090.098540.0002
XML
Image XML parsing0.00070.074630.0002
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00070.0776160.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs