Thursday 18 November 2010 9:11:37 am - 8 replies

» Read full tutorial

Introduction

In this tutorial we will learn how to use CRUD features by extending eZPersistentObject class, so it will be possible to Create, Read, Update, and Delete objects in the database in a straightforward way, without writing SQL queries.

 
Author Message

Peter Keung

Thursday 18 November 2010 4:33:28 pm

Great (and friendly) article, Thiago.

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Thiago Campos Viana

Thursday 18 November 2010 5:34:40 pm

"

Great (and friendly) article, Thiago.

"

Thanks! It could not be the best tutorial, but I think it has a good title!

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Luca Realdi

Friday 19 November 2010 12:51:16 am

Great tutorial! Thanks!

Richard Bayet

Sunday 21 November 2010 3:09:37 am

Shouldn't the sample code include basic error handling (testing the result of eZPersistentObject::fetchObject against "null" before any further method call), given the intended audience ? ;)

Thiago Campos Viana

Sunday 21 November 2010 11:29:13 am

"

Shouldn't the sample code include basic error handling (testing the result of eZPersistentObject::fetchObject against "null" before any further method call), given the intended audience ? ;)

"

Yeah, we can do a simple:

if($simpleObj!=null){
    ...
}

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Romeo Antony

Monday 22 November 2010 1:47:26 pm

Great work. Thanks for a lot for such a masterpiece.

Jérôme Vieilledent

Thursday 25 November 2010 2:09:32 am

"

Shouldn't the sample code include basic error handling (testing the result of eZPersistentObject::fetchObject against "null" before any further method call), given the intended audience ? ;)

"

Instead of Thiago reply, I'd rather something like :

if( !$obj instanceof TutorialFriendshipObject )
{
    // Handle and log the error
}

Geoff Bentley

Sunday 19 June 2011 3:53:23 am

Great explanation - very thorough references - thanks!!

You must be logged in to post messages in this topic!

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

Main resources:

Total runtime0.1663 sec
Peak memory usage4,096.0000 KB
Database Queries95

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 597.6094152.1563
Module start 'layout' 0.00420.0025 749.765639.5391
Module start 'content' 0.00670.1582 789.30471,025.7813
Module end 'content' 0.16490.0013 1,815.085926.4766
Script end 0.1662  1,841.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00291.7566160.0002
Check MTime0.00120.6940160.0001
Mysql Total
Database connection0.00050.279810.0005
Mysqli_queries0.091354.9012950.0010
Looping result0.00070.4508930.0000
Template Total0.144787.020.0723
Template load0.00191.171620.0010
Template processing0.142785.830320.0714
Template load and register function0.00010.075910.0001
states
state_id_array0.00090.571320.0005
state_identifier_array0.00080.502830.0003
Override
Cache load0.00181.0643450.0000
Sytem overhead
Fetch class attribute name0.00110.6404150.0001
Fetch class attribute can translate value0.00060.350070.0001
class_abstraction
Instantiating content class attribute0.00000.0159160.0000
XML
Image XML parsing0.00301.783470.0004
General
dbfile0.00130.7877480.0000
String conversion0.00000.005240.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.tplforum_topic/full.tplextension/community_design/design/suncana/override/templates/forum_topic/full.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/separator.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltags/separator.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
2content/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: 37
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs