Object removed

Author Message

Fabien Mas

Friday 23 February 2007 1:52:33 am

Hi,
I have my own class named "iag_quiz"
I have a specific table in my database to store the informations collected from the users
I need to delete those informations when a "iag_quiz" object is removed in the admin.

How can I intercept this event ?

Thx, Fabien

Fabien Mas

Monday 26 February 2007 5:01:47 am

nobody knows ?

Gurudutt Verma

Monday 26 February 2007 6:39:25 am

Hi Fabien,

I hope you have created new datatype to operate your table in database.
if yes then from your datatype yourdatatype.php you can add function

function deleteStoredObjectAttribute( &$objectAttribute, $version = null )
{
if( is_null( $version ) )
{
yourtableClass::removeRow( $var1, $var2 );
/*Here you can write to remove values from your custom table*/
}
}

for more information please have a look in
kernel/classes/ezdatatype.php

I hope this will help you.

Fabien Mas

Monday 26 February 2007 8:07:24 am

It works !
thx

It's just strange to use the new datatype... :)

Piotrek Karaƛ

Tuesday 13 January 2009 3:34:46 am

Gurudutt,

Your example saved me lots of confusion, as it underlines the necessity of ensuring null version, which wasn't explained anywhere else.

Thanks!

--
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

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 31 2025 00:40:13
Script start
Timing: Jan 31 2025 00:40:13
Module start 'layout'
Timing: Jan 31 2025 00:40:13
Module start 'content'
Timing: Jan 31 2025 00:40:13
Module end 'content'
Timing: Jan 31 2025 00:40:13
Script end

Main resources:

Total runtime0.0226 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.0078151.1953
Module start 'layout' 0.00540.0041 739.2031220.6484
Module start 'content' 0.00950.0115 959.85161,001.7500
Module end 'content' 0.02100.0015 1,961.601633.9922
Script end 0.0225  1,995.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002912.9331140.0002
Check MTime0.00125.1802140.0001
Mysql Total
Database connection0.00072.955010.0007
Mysqli_queries0.002511.202230.0008
Looping result0.00000.053910.0000
Template Total0.00114.810.0011
Template load0.00093.791410.0009
Template processing0.00021.001210.0002
Override
Cache load0.00062.676210.0006
General
dbfile0.00031.251580.0000
String conversion0.00000.039140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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