3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.6 2002/11/17 07:21:47 jonen |
7 |
|
# + using Class::Tangram::import_schema() again for proper usage of its helper functions |
8 |
|
# |
9 |
|
# Revision 1.5 2002/11/17 07:12:06 joko |
10 |
|
# + extended ::getProperties with argument "want_transactions" |
11 |
|
# |
12 |
# Revision 1.4 2002/11/15 13:21:39 joko |
# Revision 1.4 2002/11/15 13:21:39 joko |
13 |
# + added capability to propagate global schema options from schema module to tangram schema |
# + added capability to propagate global schema options from schema module to tangram schema |
14 |
# |
# |
53 |
my @args = (); |
my @args = (); |
54 |
@_ && (@args = @_); |
@_ && (@args = @_); |
55 |
|
|
56 |
|
$logger->debug( __PACKAGE__ . "->new" ); |
57 |
|
|
58 |
#my $self = { @_ }; |
#my $self = { @_ }; |
59 |
|
|
60 |
# merge all entries from all hashes in args-array to single array (key, val, key, val) |
# merge all entries from all hashes in args-array to single array (key, val, key, val) |
63 |
# make hash from array |
# make hash from array |
64 |
my %args = @args_all; |
my %args = @args_all; |
65 |
|
|
66 |
$logger->debug( __PACKAGE__ . "->new( @args_all )" ); |
#$logger->debug( __PACKAGE__ . "->new( @args_all )" ); |
67 |
|
|
68 |
my $self = { %args }; |
my $self = { %args }; |
69 |
bless $self, $class; |
bless $self, $class; |
70 |
|
|
71 |
|
#use Data::Dumper; print Dumper($self); |
72 |
|
|
73 |
# remember as which Class we are instantiated |
# remember as which Class we are instantiated |
74 |
$self->{invocant} = $invocant; |
$self->{invocant} = $invocant; |
75 |
|
|
151 |
|
|
152 |
my $schema_properties = {}; |
my $schema_properties = {}; |
153 |
if ($self->{invocant}->can('getProperties')) { |
if ($self->{invocant}->can('getProperties')) { |
154 |
$schema_properties = eval('return ' . $self->{invocant} . '::getProperties();'); |
# TODO: rework this! call by ref and/or do oo |
155 |
|
#$schema_properties = eval('return ' . $self->{invocant} . '::getProperties();'); |
156 |
|
$schema_properties = eval('return ' . $self->{invocant} . '::getProperties($self->{want_transactions});'); |
157 |
} |
} |
158 |
|
|
159 |
# build argument to be passed to "Tangram::Schema->new(...)" |
# build argument to be passed to "Tangram::Schema->new(...)" |
160 |
my @classes; |
my @classes; |
161 |
map { |
map { |
162 |
$logger->debug( __PACKAGE__ . "->_doinit: Initializing Class $_" ); |
$logger->debug( __PACKAGE__ . "->_doinit: Initializing Class $_" ); |
163 |
|
Class::Tangram::import_schema($_); |
164 |
# classname |
# classname |
165 |
push @classes, $_; |
push @classes, $_; |
166 |
# schema |
# schema |