HOWTO?: Fill db field with "NULL"

Author Message

Björn Dieding@xrow.de

Thursday 30 June 2005 4:16:45 am

Hi,
I am trying to fill a certain field of a persistent object with "NULL" but it does not work out... How can I do this. Filling the field with a "0" value works fine.

From func definition

"expires" => array(  'name' => "Expires",
                                                              'datatype' => 'integer',
                                                              'default' => null,
                                                              'required' => false )
                                                               )


Code that does not work for me to insert null data in db...

$mypersistentobject = new mypersistentobject( $row )
$mypersistentobject->setAttribute( 'expires', null );
$mypersistentobject->store();

thx

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Björn Dieding@xrow.de

Thursday 07 July 2005 3:26:38 am

Nobody?

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Bruce Morrison

Thursday 07 July 2005 5:17:20 am

Hi Björn

I've had a brief look at the storeObject() function of the eZPersistentObject class and it does not appear possible to achieve what you want without patching the eZPersistentObject class or overriding the storeObject() function in your class.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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

Main resources:

Total runtime0.6786 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.0058 587.9141152.6250
Module start 'layout' 0.00580.0043 740.539139.4453
Module start 'content' 0.01010.6667 779.9844546.7578
Module end 'content' 0.67690.0017 1,326.742212.1563
Script end 0.6785  1,338.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5253160.0002
Check MTime0.00130.1943160.0001
Mysql Total
Database connection0.00110.155310.0011
Mysqli_queries0.624892.0771570.0110
Looping result0.00060.0940550.0000
Template Total0.645595.120.3227
Template load0.00170.250520.0008
Template processing0.643794.864520.3219
Template load and register function0.00010.018310.0001
states
state_id_array0.00110.162010.0011
state_identifier_array0.00070.110420.0004
Override
Cache load0.00140.2090210.0001
Sytem overhead
Fetch class attribute can translate value0.00120.183520.0006
Fetch class attribute name0.00240.356150.0005
XML
Image XML parsing0.00120.169620.0006
class_abstraction
Instantiating content class attribute0.00000.002160.0000
General
dbfile0.00110.1662220.0001
String conversion0.00000.001540.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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs