Forums / Developer / $contentObjectAttribute attributes

$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

eZ debug

Timing: Jan 30 2025 21:43:36
Script start
Timing: Jan 30 2025 21:43:36
Module start 'content'
Timing: Jan 30 2025 21:43:36
Module end 'content'
Timing: Jan 30 2025 21:43:36
Script end

Main resources:

Total runtime0.0291 sec
Peak memory usage6,144.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0111 588.1563370.2969
Module start 'content' 0.01110.0130 958.45311,005.7813
Module end 'content' 0.02420.0049 1,964.234474.6875
Script end 0.0291  2,038.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00268.9480120.0002
Check MTime0.00113.8782120.0001
Mysql Total
Database connection0.00093.111810.0009
Mysqli_queries0.005920.243740.0015
Looping result0.00000.085220.0000
Template Total0.004515.510.0045
Template load0.00082.820210.0008
Template processing0.003712.643610.0037
Override
Cache load0.00051.761410.0005
General
dbfile0.00031.1317100.0000
String conversion0.00000.034430.0000
Note: percentages do not add up to 100% because some accumulators overlap

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.0001 secs