| Egg-Release documentation | view source | Contained in the Egg-Release distribution. |
Egg::Manager::Model - Model manager for Egg.
It is a module to offer Egg the model function.
When the model_manager method of Egg is called, the handler class for the model is returned.
The configuration of the model is done to 'MODEL' by the ARRAY form.
MODEL => [
[ DBI => {
dsn => ...........
..........
} ],
],
Because this class is registered in @ISA of the project, the method can be used directly from the object of the project.
$project->model( .... );
When starting for the model, it initializes it.
The setup for the model is done.
The object of the specific model specified with LABEL_STRING is returned.
When LABEL_STRING is omitted, the object of the model of default is restored.
my $dbi= $e->model;
or
my $dbi= $e->model('dbi::main');
The setting of the first element set to the configuration becomes default.
Egg::Model::DBI is attached to the model.
If the model corresponding to LABEL_STRING can be used, true is returned.
unless ($e->is_model('dbi')) {
die q{ dbi is not active. };
}
It is model manager's main body.
Egg::Manager is succeeded to and the main function is used.
The method is called by way of model_manager.
This class is succeeding to Egg::Manager and it doesn't have a peculiar method.
Masatoshi Mizuno <lushe&64;cpan.org>
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
| Egg-Release documentation | view source | Contained in the Egg-Release distribution. |