Forums / Developer / Getting content class object attributes

Getting content class object attributes

Author Message

Børge Warvik

Thursday 24 August 2006 4:35:39 am

Hi

I'm creating a feedback module. Mostly it's working fine. The feedback object is stored as a child of the content object, and the user is recieving an email that confirms that the feedback has been stored in our system.

The feedback module should also inform the author of the content object that s/he has recieved some feedback and should login to read it.

For the system to to send this email to the author(s) it need to get the authors from the content object. I've created the content class author. Every author is stored in an authorfolder. Every other contentobject has an attribute of type object relations, here are one or multiple authors referenced from the authorfolder.

Now using this code:

$node = eZContentObjectTreeNode::fetch( $NodeID );

I'm not able to get hold of these author objects.

Any idea how I can accomplish this?

Claudia Kosny

Thursday 24 August 2006 2:47:01 pm

Hi Børge

Try to fetch the contentobject of this node. The contentobject again has an attribute related_contentobject_array which should give you access to the information you want.

Greetings from Luxembourg

Claudia

Børge Warvik

Friday 25 August 2006 12:23:48 am

Hi

Thanks for the answer, but I can't seem to get it to work.

This just gives me an empty array:

$node = eZContentObjectTreeNode::fetch( $nodeID );
$coNode = eZContentObject::fetch( $node->ContentObjectID );

echo "<pre>";
print_r( $coNode->relatedContentObjectArray() );
echo "</pre>";

Could you mayby post some example code of what you mean?

Kristof Coomans

Friday 25 August 2006 1:45:23 am

Hello Børge

Try this:

$node = eZContentObjectTreeNode::fetch( $nodeID );
$object =& $node->attribute( 'object' );

echo "<pre>";
print_r( $object->relatedContentObjectList( false, false, $classAttributeID );
echo "</pre>";

where $classAttributeID is the id of the class attribute with related authors. You can also use a boolean false instead if you want all related objects (made on both object and object attribute level), and 0 (the default) for related objects made on object level.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

eZ debug

Timing: Jan 21 2025 04:15:18
Script start
Timing: Jan 21 2025 04:15:18
Module start 'content'
Timing: Jan 21 2025 04:15:18
Module end 'content'
Timing: Jan 21 2025 04:15:18
Script end

Main resources:

Total runtime0.1689 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.8281180.8281
Module start 'content' 0.00730.0070 768.656397.9297
Module end 'content' 0.01430.1546 866.5859526.8281
Script end 0.1689  1,393.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00372.1996200.0002
Check MTime0.00150.8928200.0001
Mysql Total
Database connection0.00080.448110.0008
Mysqli_queries0.116869.16301410.0008
Looping result0.00140.79921390.0000
Template Total0.154191.210.1541
Template load0.00090.545210.0009
Template processing0.153290.694210.1532
Override
Cache load0.00070.415610.0007
Sytem overhead
Fetch class attribute can translate value0.00080.464210.0008
XML
Image XML parsing0.00020.142110.0002
General
dbfile0.00975.7646200.0005
String conversion0.00000.004830.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