Forums / Setup & design / help to get an Object in PHP script

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