Changeset 23 for LATMOS-Accounts
- Timestamp:
- 04/10/09 18:48:24 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts.pm
r22 r23 26 26 } 27 27 28 # load or reload abase28 # load or a if need base 29 29 sub load_base { 30 30 my ($self, $section) = @_; 31 return ($self->{_bases}{$section} = $self->_load_base($section))31 return ($self->{_bases}{$section} ||= $self->_load_base($section)) 32 32 ? 1 33 33 : 0; … … 40 40 my %params = map { $_ => ($self->val($section, $_) || undef) } $self->Parameters($section); 41 41 return LATMOS::Accounts::Bases->new($type, %params); 42 } 43 44 sub list_bases { 45 my ($self) = @_; 46 grep { 47 $self->val($_, 'type') !~ /^(synchro)$/ 48 } $self->Sections 49 } 50 51 sub load_all_base { 52 my ($self) = @_; 53 foreach ($self->list_bases) { 54 $self->load_base($_) or do { 55 warn "Cannot load base $_\n"; 56 return 0; 57 }; 58 } 59 1; 42 60 } 43 61
Note: See TracChangeset
for help on using the changeset viewer.