return if $r->{template}; # Authentication has set this, we're done.
$r->{template} = $method;
return if $r->{template}; # Authentication has set this, we're done.
$r->{template} = $method;
-This is the engine of this module. It populates all the relevant variables
-and calls the requested action.
+This is the engine of this module. Given the request object, it populates
+all the relevant variables and calls the requested action.
Anyone subclassing this for a different database abstraction mechanism
needs to provide the following methods:
Anyone subclassing this for a different database abstraction mechanism
needs to provide the following methods:
Uses the user-defined data in C<@data> to specify a database- for
example, by passing in a DSN. The model class should open the database,
and create a class for each table in the database. These classes will
Uses the user-defined data in C<@data> to specify a database- for
example, by passing in a DSN. The model class should open the database,
and create a class for each table in the database. These classes will
-then be C<adopt>ed. It should also populate C<< $config->{tables} >> and
-C<< $config->{classes} >> with the names of the classes and tables
+then be C<adopt>ed. It should also populate C<< $config->tables >> and
+C<< $config->classes >> with the names of the classes and tables
respectively. The classes should be placed under the specified
namespace. For instance, C<beer> should be mapped to the class
C<BeerDB::Beer>.
respectively. The classes should be placed under the specified
namespace. For instance, C<beer> should be mapped to the class
C<BeerDB::Beer>.
-This is called on an model class representing a table and allows the
-master model class to do any set-up required.
+This class method is passed the name of a model class that represensts a table
+and allows the master model class to do any set-up required.
sub setup_database { die "This is an abstract method" }
sub fetch_objects { die "This is an abstract method" }
sub setup_database { die "This is an abstract method" }
sub fetch_objects { die "This is an abstract method" }
all columns in alphabetical order. Override this in base classes to
change ordering, or elect not to show columns.
all columns in alphabetical order. Override this in base classes to
change ordering, or elect not to show columns.
my ( $self, $action ) = @_;
my $cv = $self->can($action);
return 0 unless $cv;
my ( $self, $action ) = @_;
my $cv = $self->can($action);
return 0 unless $cv;