Ignore:
Timestamp:
02/27/09 19:00:29 (15 years ago)
Author:
nanardon
Message:
  • can list canonicals fields, eg fixed name to data over all data bases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm

    r5 r6  
    4040    if ($@) { return } # error message ? 
    4141    return "LATMOS::Accounts::Bases::$pclass"->new(%options); 
     42} 
     43 
     44sub _load_obj_class { 
     45    my ($self, $otype) = @_; 
     46 
     47    # finding perl class: 
     48    my $pclass = ref $self; 
     49    $pclass .= '::' . ucfirst(lc($otype)); 
     50    eval "require $pclass;"; 
     51    if ($@) { return } # error message ? 
     52    return $pclass; 
     53} 
     54 
     55=head2 list_canonicals_fields($otype) 
     56 
     57Return the list of supported fields by the database for object type $otype. 
     58 
     59=cut 
     60 
     61sub list_canonicals_fields { 
     62    my ($self, $otype) = @_; 
     63    my $pclass = $self->_load_obj_class($otype) or return; 
     64    $pclass->canonical_fields; 
    4265} 
    4366 
Note: See TracChangeset for help on using the changeset viewer.