Getting Attribute Content

Author Message

Björn Dieding@xrow.de

Thursday 24 April 2003 4:34:05 am

Unfortunatelly
$contentObject->attributes();
is returning an array and not an array of objects of contentobjectattributes
Where is my failure?
How can i get the content?

$contentObject = eZContentObject::fetch( 269 );
var_dump($contentObject);
$attributes =& $contentObject->attributes();
var_dump($attributes);
// Loop each attribute
foreach ( $attributes as $attribute )
{
print( "Content : " . $attribute->content() );
}

thx Björn

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/

Bård Farstad

Thursday 24 April 2003 4:42:44 am

Try the function contentObjectAttributes.

$attributes =& $object->contentObjectAttributes();

Or you can use the dataMap() function which will create an associative array with the attributes hashed by name.

$dataMap =& $object->dataMap();

$title = $dataMap['title'];

--bård

Documentation: http://ez.no/doc

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 18 2025 05:16:35
Script start
Timing: Jan 18 2025 05:16:35
Module start 'layout'
Timing: Jan 18 2025 05:16:35
Module start 'content'
Timing: Jan 18 2025 05:16:36
Module end 'content'
Timing: Jan 18 2025 05:16:36
Script end

Main resources:

Total runtime0.8298 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 587.9141152.6250
Module start 'layout' 0.00700.0060 740.539139.4453
Module start 'content' 0.01300.8152 779.9844531.8594
Module end 'content' 0.82820.0014 1,311.84388.1641
Script end 0.8296  1,320.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.5063160.0003
Check MTime0.00140.1659160.0001
Mysql Total
Database connection0.00080.099210.0008
Mysqli_queries0.772693.1064540.0143
Looping result0.00060.0674520.0000
Template Total0.778693.820.3893
Template load0.00310.370720.0015
Template processing0.775593.465420.3878
Template load and register function0.00010.011910.0001
states
state_id_array0.00180.215210.0018
state_identifier_array0.00270.324520.0013
Override
Cache load0.00270.3201270.0001
Sytem overhead
Fetch class attribute can translate value0.00070.084020.0003
Fetch class attribute name0.00120.147240.0003
XML
Image XML parsing0.00120.144620.0006
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00110.1344230.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs