[Dbix-class] Re: want to confirm on issue in cookbook

Mike.G hylinux at gmail.com
Mon Nov 10 09:18:32 GMT 2008


ok. thanks



2008/11/10 Joel Bernstein <joel at fysh.org>

> 2008/11/10 Mike. G <hylinux at gmail.com>:
> > about this statement:
> >
> > $new_source->name( \<<SQL );
> >
> >
> > why I can't find out the method name "name" in class ResultSource?
>
> Because it's not a method defined with "sub name { ... }" but a simple
> data accessor created with:
> __PACKAGE__->mk_group_accessors('simple' =3D> qw/_ordered_columns
>  _columns _primaries _unique_constraints name resultset_attributes
>  schema from _relationships column_info_from_storage source_info
>  source_name/);
>
> Note "name" as the fourth entry on the second line. That creates an
> accessor/mutator
> method (a combined get and set method) called "name".
> mk_group_accessors is inherited
> from DBIx::Class, which in turn inherits it from
> Class::Accessor::Grouped, which is the property
> accessor generator used in the current CPAN release of DBIC.
>
> Hope this helps,
>
> /joel
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20081110/314=
33a17/attachment.htm


More information about the DBIx-Class mailing list