[Catalyst] How do I access 'Catalysed' custom datasets?

Eden Cardim edencardim at gmail.com
Wed Mar 19 12:22:34 GMT 2008


On Tue, Mar 18, 2008 at 4:40 PM, Ian Sillitoe <ian at sillit.com> wrote:
>  sub get_custom_resultset {
>   my ($from, $to) = @_;
>    my $result_source_name = "ResultSetFrom${from}To${to}";
>   my $result_source;
>
>   # check if we haven't already made this
>   if ( grep { $reps_source_name eq $_ } MySchema->sources() ) {
>      $result_source = MySchema->resultset($reps_source_name);
>   }
<snip>
> Is this something to do with setting the __PACKAGE__->resultset_class (if
> so, I'll take it to the dbi-class list)?

No, it's got to do with the fact that you seem to be confused about
what ResultSets and ResultSources are, they're very different things.
So, yes take it to the DBIC mailing list.

> Side question - should I expect the
> 'catalysed' schema to behave exactly the same as the non-catalysed schema?

There's no such thing as a "Catalysed Schema", what
Catalyst::Model::DBIC::Schema does is create accessor methods which
conveniently access the schema for you. Thus, $c->model('Schema::Foo')
actually calls $c->model('Schema')->schema->resultset('Foo') behind
the scenes.

-- 
edenc.vox.com



More information about the Catalyst mailing list