| 1 | |||||||||||
| 2 | package Email::Blaster::Model::Dynamic; | ||||||||||
| 3 | |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use warnings 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Email::Blaster::ConfigLoader; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | #============================================================================== | ||||||||||
| 10 | sub import | ||||||||||
| 11 | 2 | ▶ | { | ||||||||
|
Subroutine
import: called CC=2 SCAR=10.3
| |||||||||||
| 12 | 2 | my $caller = caller(0); | |||||||||
| 13 | # Use dynamic inheritance. Because this is Perl. Because we can. | ||||||||||
| 14 | 2 | my $config = Email::Blaster::ConfigLoader->load(); | |||||||||
| 15 | 0 | (my $pkg = $config->database->orm_base_class . ".pm") =~ s/::/\//g; | |||||||||
| 16 | 0 | ▶ | require $pkg unless $INC{$pkg}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 2 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 0 | push @{"$caller\::ISA"}, $config->database->orm_base_class; | |||||||||
| 19 | 0 | $caller->connection( | |||||||||
| 20 | $config->database->dsn, | ||||||||||
| 21 | $config->database->username, | ||||||||||
| 22 | $config->database->password | ||||||||||
| 23 | ); | ||||||||||
| 24 | }# end import() | ||||||||||
| 25 | |||||||||||
| 26 | 2 | 1;# return true: | |||||||||
| 27 | |||||||||||