cvsuser 05/11/15 08:47:23
Modified: App-Repository/lib/App/SessionObject RepositoryObjectSet.pm
Log:
remove set_table(). The table needs to be defined at construction time
Revision Changes Path
1.8 +12 -10
p5ee/App-Repository/lib/App/SessionObject/RepositoryObjectSet.pm
Index: RepositoryObjectSet.pm
===================================================================
RCS file:
/cvs/public/p5ee/App-Repository/lib/App/SessionObject/RepositoryObjectSet.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RepositoryObjectSet.pm 7 Nov 2005 20:08:51 -0000 1.7
+++ RepositoryObjectSet.pm 15 Nov 2005 16:47:23 -0000 1.8
@@ -49,13 +49,13 @@
sub _init {
&App::sub_entry if ($App::trace);
my ($self, $args) = @_;
+ my $table = $self->{table} || die "table not defined";
$self->_clear_cache_if_auto_params_changed() if ($self->{auto_params});
# sets params from auto_params
$self->_clear_cache_if_auto_columns_changed() if
($self->{auto_columns}); # sets columns from auto_columns
if (!$self->{columns}) {
my $context = $self->{context};
my $repname = $self->{repository};
my $rep = $context->repository($repname);
- my $table = $self->{table} || die "table not defined";
$self->{columns} = $rep->_get_default_columns($table);
}
$self->SUPER::_init();
@@ -133,14 +133,16 @@
&App::sub_exit() if ($App::trace);
}
-sub set_table {
- &App::sub_entry if ($App::trace);
- my ($self, $table, $repository) = @_;
- $self->{repository} = $repository || "default";
- $self->{table} = $table;
- $self->_clear_cache();
- &App::sub_exit() if ($App::trace);
-}
+# The RepositoryObjectSet should know its table at construction time.
+# It should never allow the table to be set afterwards.
+#sub set_table {
+# &App::sub_entry if ($App::trace);
+# my ($self, $table, $repository) = @_;
+# $self->{repository} = $repository || "default";
+# $self->{table} = $table;
+# $self->_clear_cache();
+# &App::sub_exit() if ($App::trace);
+#}
sub set_params {
&App::sub_entry if ($App::trace);