HOWTO? Use eZContentobjectAttribute::setContent() on a simple text datatype

Author Message

Björn Dieding@xrow.de

Wednesday 04 August 2004 5:27:40 am

Current code I use.....

        $data_map =& $contentObject->attribute("data_map");
        $data_map['name']->setAttribute( 'data_text', 'Monthly Service' );
        $data_map['name']->store();

But know I would like to use setContent.... Somhow the code does not work

How do I use it?

        $content = 'Monthly Service';
        $data_map =& $contentObject->attribute("data_map");
        $data_map['name']->setContent( $content );
        $data_map['name']->store();

 

thx for your suggestions

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/

Jan Borsodi

Thursday 05 August 2004 1:36:40 am

The <i>setContent()</i> wasn't created for this behaviour actually, some datatypes do this but only internally.

Hower to remedy the problem with inserting data uniformly some new additions are being made to the eZDatatype interface.

Currently these are added:
<i>insertHTTPFile</i> - Insert an uploaded file (HTTP Post)
<i>insertRegularFile</i> - Insert a local file
<i>insertSimpleString</i> - Insert a simple string

It is also possible to query if a datatype supports any of these insert methods.

But this will only help if you are using 3.5.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Björn Dieding@xrow.de

Thursday 05 August 2004 2:53:23 am

Thx amos,
for this info.

I will test/use those methods when I need them the next time.

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/

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 31 2025 08:15:42
Script start
Timing: Jan 31 2025 08:15:42
Module start 'layout'
Timing: Jan 31 2025 08:15:42
Module start 'content'
Timing: Jan 31 2025 08:15:42
Module end 'content'
Timing: Jan 31 2025 08:15:42
Script end

Main resources:

Total runtime0.0134 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.0045 588.6094151.2734
Module start 'layout' 0.00450.0022 739.882836.7266
Module start 'content' 0.00670.0055 776.609494.3750
Module end 'content' 0.01220.0012 870.984433.9922
Script end 0.0134  904.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.7958140.0002
Check MTime0.00107.7695140.0001
Mysql Total
Database connection0.00064.520210.0006
Mysqli_queries0.002115.544330.0007
Looping result0.00000.090410.0000
Template Total0.00097.010.0009
Template load0.00075.151310.0007
Template processing0.00021.769110.0002
Override
Cache load0.00053.577210.0005
General
dbfile0.001612.261480.0002
String conversion0.00000.042540.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