$contentObjectAttribute attributes

Author Message

Ivan Švogor

Thursday 14 October 2010 7:50:23 am

Hello,

I want to ask about setting attributes in datatypes. In method fetchObjectAttributeHTTPInput, i use $contentObjectAttribute->setAttribute("data_text", $data);

I want to ask about this "data_text". What is this? - what if I want to set multiple "texts". With this I can transfer only one value (unless I use some kind of separator). Where can I find some reference of this method?

Ivo Lukac

Thursday 14 October 2010 9:16:56 am

Hi Ivan,

eZ attributes table in database has only trivial storage capabilities: data_text field, data_int field, data_float field, etc.

For more complex cases you can use delimiters (as you self suggested) , code it in xml (like ezxmltext or ezmatrix) or use other tables (like ezkeyword).

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivan Švogor

Thursday 14 October 2010 10:30:25 am

Bok Ivo, so we meet again :)

Hmm.. That isn't so pactical, but XML saves the day ..

It seems that NetGen is pretty active in this forum. Thank you for your answer.

Marko Žmak

Thursday 14 October 2010 2:45:56 pm

Hi Ivan, just a note...

For even more complex datatypes, you can create your own table in the database, store all the data there, and relate it with a foreign key to the attribute. Of course you'll have to write your own code for storing and retreiving data.

For example, that's how the ezcomments extension works.

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

Hubert Farnsworth

Ivo Lukac

Friday 15 October 2010 12:30:57 am

"

Bok Ivo, so we meet again :)

Hmm.. That isn't so pactical, but XML saves the day ..

It seems that NetGen is pretty active in this forum. Thank you for your answer.

"

If you don't need to filter the data with SQL use XML...

YACT (yet another Croatian thread)

;)

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Gaetano Giunta

Friday 15 October 2010 12:40:31 am

 If you don't need to filter the data with SQL use XML...

And if you do not need attributes besides elements use JSON! ;-)

Principal Consultant International Business
Member of the Community Project Board

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 16:17:14
Script start
Timing: Jan 18 2025 16:17:14
Module start 'layout'
Timing: Jan 18 2025 16:17:14
Module start 'content'
Timing: Jan 18 2025 16:17:15
Module end 'content'
Timing: Jan 18 2025 16:17:15
Script end

Main resources:

Total runtime0.6052 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.9219152.6250
Module start 'layout' 0.00610.0042 740.546939.4688
Module start 'content' 0.01030.5934 780.0156659.0938
Module end 'content' 0.60370.0014 1,439.109416.1563
Script end 0.6051  1,455.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5799160.0002
Check MTime0.00160.2595160.0001
Mysql Total
Database connection0.00090.141010.0009
Mysqli_queries0.543089.7216710.0076
Looping result0.00070.1236690.0000
Template Total0.569794.120.2849
Template load0.00180.301220.0009
Template processing0.567993.844320.2839
Template load and register function0.00020.040810.0002
states
state_id_array0.00130.213710.0013
state_identifier_array0.00140.231020.0007
Override
Cache load0.00150.2547340.0000
Sytem overhead
Fetch class attribute can translate value0.00060.097240.0001
Fetch class attribute name0.00110.183890.0001
XML
Image XML parsing0.00150.251040.0004
class_abstraction
Instantiating content class attribute0.00000.0039100.0000
General
dbfile0.00200.3294310.0001
String conversion0.00000.001540.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs