Ignore:
Timestamp:
10/01/12 18:14:22 (12 years ago)
Author:
nanardon
Message:

add temp_switch_unexported() function

File:
1 edited

Legend:

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

    r1181 r1182  
    534534        $field, $min, $max); 
    535535    my %existsid; 
    536     my $oldunexported = $base->unexported(1); 
    537     foreach ($base->list_objects($class->type)) { 
    538         my $obj = $base->get_object($class->type, $_) or next; 
    539         my $id = $obj->_get_c_field($field) or next; 
    540         $existsid{$id + 0} = 1; 
    541     } 
    542     $base->unexported($oldunexported); 
     536    $base->temp_switch_unexported(sub { 
     537        foreach ($base->list_objects($class->type)) { 
     538            my $obj = $base->get_object($class->type, $_) or next; 
     539            my $id = $obj->_get_c_field($field) or next; 
     540            $existsid{$id + 0} = 1; 
     541        } 
     542    }, 1); 
    543543    $min += 0; 
    544544    $max += 0; 
Note: See TracChangeset for help on using the changeset viewer.