Content class create/modify API/PHP

Author Message

Piotrek Karaś

Tuesday 25 November 2008 9:00:13 am

Hi,

Does anyone have an isolated eZ API (PHP) example or tutorial for creating and editing eZ Publish content classes (not content objects)? I will probably be able to isolate it myself, but maybe some could save me up some hours ;)

Thanks in advance,

Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Piotrek Karaś

Saturday 06 December 2008 11:42:08 pm

Come on, guys. I've been sick for some time, and I was sure that I would have a nice surprise when I'm back in front of eZ ;)

Can't believe no one has ever created classes dynamically...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

André R.

Sunday 07 December 2008 4:00:09 am

Never done this, but you should find what you need to create a class in kernel/class/edit.php on line 128 - 140, but the code that handles attributes are 'a bit' specific for the view.
kernel/class/copy.php might be a better starting point for the attributes.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 19 2025 03:21:21
Script start
Timing: Jan 19 2025 03:21:21
Module start 'layout'
Timing: Jan 19 2025 03:21:21
Module start 'content'
Timing: Jan 19 2025 03:21:22
Module end 'content'
Timing: Jan 19 2025 03:21:22
Script end

Main resources:

Total runtime0.6758 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.1797152.6250
Module start 'layout' 0.00630.0032 741.804739.4453
Module start 'content' 0.00950.6649 781.2500545.8906
Module end 'content' 0.67430.0014 1,327.140612.1563
Script end 0.6757  1,339.2969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4811160.0002
Check MTime0.00140.2001160.0001
Mysql Total
Database connection0.00150.223010.0015
Mysqli_queries0.623192.2019570.0109
Looping result0.00050.0709550.0000
Template Total0.647495.820.3237
Template load0.00200.300220.0010
Template processing0.645495.505720.3227
Template load and register function0.00010.015210.0001
states
state_id_array0.00070.101110.0007
state_identifier_array0.00080.121920.0004
Override
Cache load0.00170.2488160.0001
Sytem overhead
Fetch class attribute can translate value0.00060.087020.0003
Fetch class attribute name0.00100.144050.0002
XML
Image XML parsing0.00090.132420.0004
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00160.2366240.0001
String conversion0.00000.000840.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs