[Dbix-class] HOWTO: functions in update

Krzysztof Krzyzaniak eloy at kofeina.net
Mon Jun 19 22:04:52 CEST 2006


Now I have something like;

my $row = $c->model('SireDB::Article')->find($result->params->{'id'});
if ($row->id == $result->params->{'id'})
{
	$row->body($result->params->{'editarea'});
	$row->title($result->params->{'title'});
	$row->changed( localdate(time) );
	$row->update;
}
where localdate came from Class::Date and is equal current unix time

but because of some reason I wanted use "database server time", I mean 
use "now()" sql function. How to do this?

=pod
this doesn't work because create literal

	update table changed = 'now()'

instead of

	update table changed = now()
=cut
$row->changed( 'now()' );


   eloy
-- 
-------e-l-o-y-----------e-l-o-y- at -t-r-a-n-s-i-l-v-a-n-i-a-.-e-u-.-o-r-g------

        jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej



More information about the Dbix-class mailing list