cvs commit: p5ee/App-Repository/lib/App/SessionObject RepositoryObjectDomain.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/09/16 07:46:05

  Modified:    App-Repository/lib/App/SessionObject
                        RepositoryObjectDomain.pm
  Log:
  added configurable table and param mappings
  
  Revision  Changes    Path
  1.6       +5 -8      p5ee/App-Repository/lib/App/SessionObject/RepositoryObjectDomain.pm
  
  Index: RepositoryObjectDomain.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/lib/App/SessionObject/RepositoryObjectDomain.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RepositoryObjectDomain.pm	13 Sep 2005 15:10:38 -0000	1.5
  +++ RepositoryObjectDomain.pm	16 Sep 2005 14:46:05 -0000	1.6
  @@ -93,15 +93,11 @@
           $new_args->{class} = "App::SessionObject::RepositoryObjectSet";
       }
       if (!$new_args->{table}) {
  -        $new_args->{table} = $table;
  +        $new_args->{table} = $tabledef->{table} || $table;
       }
       if (!$new_args->{params}) {
  -        if ($tabledef->{params}) {
  -            $new_args->{params} = $tabledef->{params};
  -        }
  -        else {
  -            $new_args->{params} = $domain_params;
  -        }
  +        my $new_params = $tabledef->{params} || $domain_params || {};
  +        $new_args->{params} = { %$new_params };
       }
       my $object_set = $context->session_object($object_set_name, %$new_args);
       $tabledef->{gotten} = 1;
  @@ -111,6 +107,7 @@
           my $corresponding_domain_param = $tabledef->{params};
           foreach my $set_param (keys %$corresponding_domain_param) {
               $domain_param = $corresponding_domain_param->{$set_param};
  +            $domain_param = $set_param if ($domain_param eq "1");
               $object_set_param_values{$set_param} = $domain_params->{$domain_param};
           }
           $object_set->update_params(\%object_set_param_values);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.