[system] / branches / rel-2-1-a1 / webwork-modperl / lib / WeBWorK / DB.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-1-a1/webwork-modperl/lib/WeBWorK/DB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 930 Revision 931
24 24
25sub new($$) { 25sub new($$) {
26 my ($invocant, $ce) = @_; 26 my ($invocant, $ce) = @_;
27 my $class = ref($invocant) || $invocant; 27 my $class = ref($invocant) || $invocant;
28 my $self = {}; 28 my $self = {};
29 bless $self, $class; # bless this here so we can pass it to the schema
29 30
30 # load the modules required to handle each table, and create driver 31 # load the modules required to handle each table, and create driver
31 foreach my $table (TABLES) { 32 foreach my $table (TABLES) {
32 unless (defined $ce->{dbLayout}->{$table}) { 33 unless (defined $ce->{dbLayout}->{$table}) {
33 #warn "ignoring table $table: layout not specified in dbLayout"; # *** 34 warn "ignoring table $table: layout not specified in dbLayout"; # ***
34 next; 35 next;
35 } 36 }
36 37
37 my $layout = $ce->{dbLayout}->{$table}; 38 my $layout = $ce->{dbLayout}->{$table};
38 my $record = $layout->{record}; 39 my $record = $layout->{record};
42 my $params = $layout->{params}; 43 my $params = $layout->{params};
43 44
44 runtime_use($record); 45 runtime_use($record);
45 runtime_use($schema); 46 runtime_use($schema);
46 runtime_use($driver); 47 runtime_use($driver);
47 $self->{$table} = $schema->new($driver->new($source, $params), $table, $record, $params); 48 $self->{$table} = $schema->new(
49 $self,
50 $driver->new($source, $params),
51 $table,
52 $record,
53 $params
54 );
48 } 55 }
49 56
50 bless $self, $class;
51 return $self; 57 return $self;
52} 58}
53 59
54################################################################################ 60################################################################################
55# password functions 61# password functions

Legend:
Removed from v.930  
changed lines
  Added in v.931

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9