how can i get data from object ?

Author Message

Selmah Maxim

Monday 19 May 2003 5:26:25 am

Hi,

How can i get the data from object ?

$node =& eZContentObjectTreeNode::fetch( $parameters['node_id'] );

i get object with what i need, but how to view it, let say i wanna get just 1 value from this object !

Tony Wood

Monday 19 May 2003 5:38:27 am

Try these:
{$node.data_map|attribute(show, 1)}
{$node.object|attribute(show, 1)}

Attribute show can be used on any variable and is really handy when tracking down template issues.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Selmah Maxim

Monday 19 May 2003 5:44:57 am

not with template lang, i need it from php file !

Tony Wood

Monday 19 May 2003 5:46:40 am

to do this create an operator and then pass the values back to the template to see them...

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Selmah Maxim

Monday 19 May 2003 5:47:40 am

this the object with print_r :

ezcontentobject Object
(
[PersistentDataDirty] =>
[ID] => 81
[Name] => My Test
[CurrentLanguage] => eng-GB
[ClassName] => Test Data
[DataMap] => Array
(
)

[ContentActionList] =>
[ContentObjectAttributes] => Array
(
)

[SectionID] => 3
[OwnerID] => 14
[ClassID] => 7
[IsPublished] => 0
[Published] => 1052936394
[Modified] => 1052987482
[CurrentVersion] => 4
[Status] => 1
[RemoteID] =>
[Permissions] => Array
(
)

)
___________
now how can i get the Published value alone ?

Selmah Maxim

Monday 19 May 2003 5:49:01 am

hmmm ..

u mean :

$pub = $node->create(attribute->("Published"));

?

Selmah Maxim

Monday 19 May 2003 5:53:01 am

i got another empty object :(

Tony Wood

Monday 19 May 2003 5:56:49 am

http://ez.no/sdk/ezutils has details on the API and eZRSS in contributed items has an example of use.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Selmah Maxim

Monday 19 May 2003 5:57:54 am

ok, thx i`ll check it if not i`ll post back here !

Selmah Maxim

Monday 19 May 2003 6:28:04 am

didn`t help ,,, i didn`t find what i need !

the data is there, but how to access it ?!

Selmah Maxim

Monday 19 May 2003 6:49:11 am

Tony ..

i don`t need to pass anything to the template (for now), all what i need to get the data from the object.

am trying to make new workflow, checking the published date and the enum value, the enum value is timestamp, and is published+enumvalue>= current_date, then the data will be unactive ... easy idea to do it alone with simple php, but it`s look complex in ez32 !

Selmah Maxim

Monday 19 May 2003 7:28:03 am

is there better way ?

_________
$node =& eZContentObjectTreeNode::fetch( $parameters['node_id'] );
$data_map = $node->attribute("data_map");
$Object = $node->attribute("object");

// enum value
$enumAttribute = $data_map[ 'registeration_period' ];
$enumObj = $enumAttribute->attribute( 'content' );
$enumobjectList = $enumObj->attribute( 'enumobject_list' );
$selectedEnumValue = $enumobjectList[0]->attribute( 'enumvalue' );

//
foreach ($Object as $Name=>$Value)
{
if("$Name" == "ID") $Data[$Name] = $Value;
if("$Name" == "ClassID") $Data[$Name]= $Value;
if("$Name" == "Published") $Data[$Name] = $Value;
if("$Name" == "CurrentVersion") $Data[$Name] = $Value;
}

echo $Data[Published]+$selectedEnumValue;
echo "<br>";
echo strtotime("now");

____________________

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 30 2025 22:28:42
Script start
Timing: Jan 30 2025 22:28:42
Module start 'layout'
Timing: Jan 30 2025 22:28:42
Module start 'content'
Timing: Jan 30 2025 22:28:43
Module end 'content'
Timing: Jan 30 2025 22:28:43
Script end

Main resources:

Total runtime1.3607 sec
Peak memory usage8,192.0000 KB
Database Queries84

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.1328151.2109
Module start 'layout' 0.00580.0040 739.3438220.6875
Module start 'content' 0.00981.3500 960.03134,551.8281
Module end 'content' 1.35990.0008 5,511.859419.8438
Script end 1.3607  5,531.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2312160.0002
Check MTime0.00120.0868160.0001
Mysql Total
Database connection0.00060.046010.0006
Mysqli_queries1.251591.9720840.0149
Looping result0.00070.0549820.0000
Template Total1.306396.020.6532
Template load0.00210.152520.0010
Template processing1.304295.850520.6521
Template load and register function0.00160.116310.0016
states
state_id_array0.00180.131010.0018
state_identifier_array0.00200.149020.0010
Override
Cache load0.00200.1485910.0000
Sytem overhead
Fetch class attribute can translate value0.00160.115420.0008
Fetch class attribute name0.00270.1973130.0002
XML
Image XML parsing0.00060.043920.0003
class_abstraction
Instantiating content class attribute0.00000.0024150.0000
General
dbfile0.00080.0596160.0001
String conversion0.00000.000540.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
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
20content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/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: 46
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs