help to get an Object in PHP script

Author Message

SathishKumar Subramanian

Thursday 08 April 2004 10:20:21 pm

Hi Everyone,

I want to get the current object and its attributes (also their values) using PHP script. Could any one guide me to get those details? Please help.

Thanks & regards,
Sathish

Björn Dieding@xrow.de

Tuesday 13 April 2004 5:32:33 am

You mean somthing like this?

$co = & eZContentObject:fetch($objectid);
$datamap = & $co->atrribute('data_map');
$sometext = $datamap['body']->content();

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

SathishKumar Subramanian

Wednesday 14 April 2004 4:31:31 am

Hi Björn,

Thanks for your reply . Yes, I need to get the attributes of the current object using the PHP script.

I have included the piece of PHP script which you have mentioned. The code is:

include_once("kernel/classes/ezcontentobject.php");
$co = & eZContentObject:fetch($objectid); /* line 22 */
$datamap = & $co->atrribute('data_map'); /* line 23 */
$sometext = $datamap['resource_folder']->content(); /* Attribute is resource_folder */

But I am getting error like:

Fatal error: Call to a member function on a non-object in /home/hopetalk/ezpublish-3.2-4/extension/urlredirect/modules/urlredirect/redirect.php on line 23
Fatal error: eZ publish did not finish it's request
The execution of eZ publish was abruptly ended, the debug output is present below. ...

I didnt know about the object ID. Is it because of the object ID?
If so then how can I get the Object ID ?

Or am I implementing the code wrong?

Please help me to get the solution.

Thanks & regards,
Sathish

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 19 2025 01:23:49
Script start
Timing: Jan 19 2025 01:23:49
Module start 'layout'
Timing: Jan 19 2025 01:23:49
Module start 'content'
Timing: Jan 19 2025 01:23:50
Module end 'content'
Timing: Jan 19 2025 01:23:50
Script end

Main resources:

Total runtime0.5770 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 590.4063152.6406
Module start 'layout' 0.00490.0027 743.046939.4609
Module start 'content' 0.00750.5678 782.5078537.8281
Module end 'content' 0.57540.0016 1,320.335912.1563
Script end 0.5769  1,332.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5287160.0002
Check MTime0.00130.2223160.0001
Mysql Total
Database connection0.00080.137410.0008
Mysqli_queries0.527491.4087570.0093
Looping result0.00060.1033550.0000
Template Total0.549595.220.2747
Template load0.00240.419820.0012
Template processing0.547094.809020.2735
Template load and register function0.00020.029310.0002
states
state_id_array0.00080.130310.0008
state_identifier_array0.00120.209420.0006
Override
Cache load0.00200.3446290.0001
Sytem overhead
Fetch class attribute can translate value0.00090.155320.0004
Fetch class attribute name0.00120.202240.0003
XML
Image XML parsing0.00060.100020.0003
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00080.1364160.0000
String conversion0.00000.001440.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs