From: Marcus Ramberg Date: Mon, 16 Apr 2007 12:55:44 +0000 (+0000) Subject: Updated cookbook example X-Git-Tag: v0.08010~167 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b50216ef0fb096f61405a93a96b68a1d1b62bf4;p=dbsrgits%2FDBIx-Class.git Updated cookbook example --- diff --git a/Changes b/Changes index eb87d1b..71f2504 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for DBIx::Class + - Update cookbook example for overriding new + 0.07005 2007-01-10 18:36:00 - fixup changes file - remove erroneous .orig files - oops diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index e95a95c..52bb889 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -571,11 +571,13 @@ It's as simple as overriding the C method. Note the use of C. sub new { - my ( $class, $attrs ) = @_; + my ( $self, $attrs ) = @_; $attrs->{foo} = 'bar' unless defined $attrs->{foo}; - $class->next::method($attrs); + $self->next::method($attrs); + + return $self; } For more information about C, look in the L