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

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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 X

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

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/Exponential-3.2-4/extension/urlredirect/modules/urlredirect/redirect.php on line 23
Fatal error: Exponential did not finish it's request
The execution of Exponential 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