problem getting class of an object

Author Message

Marko Žmak

Sunday 11 July 2004 7:00:54 am

I'm using get_class on an object like this:

{$forum.item|get_class}

where $forum is a loop variable. I also tried this:

{$forum.item.object|get_class}

And I get these results:

ezcontentobjecttreenode
ezcontentobject

How can I found out the real class of an object, for example, detect if some object is of class Folder or class Article?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Paul Forsyth

Sunday 11 July 2004 8:05:59 am

I think the operator is working as expected but it is, for me, the wrong answer. The operator is returning the PHP class, not the eZ publish class, which is the expected answer...

Can you file a bug enhancement? Its not quite a bug.

For the class you can get the class id from this:

{$forum.item.object.contentclass_id}

paul

--
http://www.visionwt.com

Marko Žmak

Sunday 11 July 2004 12:03:59 pm

That's what i was looking for. Thanks.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Tuesday 13 July 2004 9:15:00 am

With:

{$forum.item.object.contentclass_id}

i get the class ID, but how do I get the class identifier? E.g. article for Article class,

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Paul Forsyth

Tuesday 13 July 2004 12:32:05 pm

Its as it sounds:

{$forum.item.object.class_identifier}

To see what fields there are try:

{$forum.item.object|attribute(show)}

paul

--
http://www.visionwt.com

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 04:33:09
Script start
Timing: Jan 19 2025 04:33:09
Module start 'layout'
Timing: Jan 19 2025 04:33:09
Module start 'content'
Timing: Jan 19 2025 04:33:09
Module end 'content'
Timing: Jan 19 2025 04:33:09
Script end

Main resources:

Total runtime0.0166 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1563152.6250
Module start 'layout' 0.00560.0040 741.781339.4453
Module start 'content' 0.00960.0051 781.226693.4297
Module end 'content' 0.01470.0019 874.656334.3047
Script end 0.0165  908.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002515.1071140.0002
Check MTime0.00126.9882140.0001
Mysql Total
Database connection0.00074.506810.0007
Mysqli_queries0.003420.548930.0011
Looping result0.00000.174110.0000
Template Total0.00169.410.0016
Template load0.00085.105210.0008
Template processing0.00074.236410.0007
Override
Cache load0.00063.717110.0006
General
dbfile0.00032.026880.0000
String conversion0.00000.066240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0001 secs