Forums / Developer / how can i get data from object ?

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");

____________________

eZ debug

Timing: Jan 30 2025 07:02:00
Script start
Timing: Jan 30 2025 07:02:00
Module start 'content'
Timing: Jan 30 2025 07:02:00
Module end 'content'
Timing: Jan 30 2025 07:02:00
Script end

Main resources:

Total runtime0.3723 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0106 587.9297370.2969
Module start 'content' 0.01060.0133 958.22661,013.5313
Module end 'content' 0.02390.3483 1,971.75783,901.5859
Script end 0.3722  5,873.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00441.1820200.0002
Check MTime0.00130.3420200.0001
Mysql Total
Database connection0.00100.274010.0010
Mysqli_queries0.266371.51621410.0019
Looping result0.00160.43001390.0000
Template Total0.347993.410.3479
Template load0.00080.213810.0008
Template processing0.347193.229610.3471
Override
Cache load0.00050.138610.0005
Sytem overhead
Fetch class attribute can translate value0.00170.445910.0017
XML
Image XML parsing0.00030.081710.0003
General
dbfile0.01022.7352200.0005
String conversion0.00000.001630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs