Dynamic Object Creation

Author Message

Florent GUERIN

Tuesday 28 July 2009 2:27:19 am

Hi All,

This is my situation: I have a database which contain data about geographic and administration organisation of France. (like province, town, elected representative)

My question is about Dynamic creation of object, It is possible for me to dynamically create object based on this database ? So i have for example a listing of information about a town, province, elected representative, ...

I hope you can help me.

Thank you.

Florent GUERIN

Matthieu Sévère

Tuesday 28 July 2009 4:50:15 am

You have a nice function to create object eZContentFunctions::createAndPublishObject()
You just have to give attributes of the object to this function and it creates the object using fromString function of datatypes.

I think that with this you can easily implement a script to publish whatever you want.

--
eZ certified developer: http://ez.no/certification/verify/346216

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

Main resources:

Total runtime0.6731 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.0073 589.0156152.6094
Module start 'layout' 0.00730.0041 741.625039.4141
Module start 'content' 0.01140.6602 781.0391523.3438
Module end 'content' 0.67160.0015 1,304.38288.1875
Script end 0.6731  1,312.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5429160.0002
Check MTime0.00130.1972160.0001
Mysql Total
Database connection0.00060.094510.0006
Mysqli_queries0.622992.5405540.0115
Looping result0.00070.1007520.0000
Template Total0.634794.320.3174
Template load0.00230.346520.0012
Template processing0.632493.947420.3162
Template load and register function0.00020.031310.0002
states
state_id_array0.00140.200710.0014
state_identifier_array0.00160.244420.0008
Override
Cache load0.00190.2872140.0001
Sytem overhead
Fetch class attribute can translate value0.00260.379020.0013
Fetch class attribute name0.00230.340230.0008
XML
Image XML parsing0.00150.224620.0008
class_abstraction
Instantiating content class attribute0.00000.001330.0000
General
dbfile0.00160.2362160.0001
String conversion0.00000.001740.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs