FAQ

On Fri, Feb 25, 2011 at 2:27 AM, John M. Dlugosz wrote:
?On 2/25/2011 4:06 AM, Tomas Doran bobtfish-at-bobtfish.net |Catalyst/Allow
to home| wrote:
__PACKAGE__->meta->make_immutable;
1;

And you then call $c->model('Foo')->data;

The implementation of the 'data' method could then later be replaced by an
attribute (i.e. has data => ( is => 'ro', isa => 'HashRef' );), and would
then get the data from config, or something more complex (e.g. to get the
data out of DBI, or another model, or whatever).

HTH
Cheers
t0m
Thanks. ?Is '$c->model('Foo')->data' what something like DBIC gives us, too?
?That is, is a method named 'data' the convention? ?That is, if code was
given a "result set" (I think that is the right term) of a query that was
made on one of the main standard model types, what would the list of records
look like?
What t0m suggested is perfectly fine but if you want to mimic the DBIC
API with a different engine, this example does that (superficially and
as a tutorial only): http://sedition.com/a/2739 Log file model?Apache
access log. The reason that example makes sense is because the
underlying model/data is similar: searchable, sortable rows. If you're
trying to shoehorn in something dissimilar, you might be making a
mistake.

-Ashley

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 8 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedFeb 25, '11 at 1:56a
activeMar 1, '11 at 1:23p
posts8
users5
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase