Ignore:
Timestamp:
02/26/09 05:52:34 (15 years ago)
Author:
nanardon
Message:
  • basics doc and functions
File:
1 edited

Legend:

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

    r2 r3  
    66use LATMOS::Accounts::Bases::Objects; 
    77 
    8 our $VERSION = (q$Rev$ =~ /$Rev: (\d+) /)[0]; 
     8our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
     9 
     10=head1 NAME 
     11 
     12LATMOS::Accounts::Bases - Base class for account data bases 
     13 
     14=head1 SYNOPSIS 
     15 
     16  use LATMOS::Accounts::Bases; 
     17  my $base = LATMOS::Accounts::Bases->new('type', %options); 
     18  ... 
     19 
     20=head1 DESCRIPTION 
     21 
     22This module provide basic functions for various account base 
     23 
     24=head1 FUNTIONS 
     25 
     26=cut 
     27 
     28=head2 new($type, %options) 
     29 
     30Return, if success, a new data base account object, $type is 
     31account base type, %options to setup the base. 
     32 
     33=cut 
    934 
    1035sub new { 
     
    1742} 
    1843 
     44=head2 get_object($type, $id) 
     45 
     46Return an object of $type (typically user or group) having identifier 
     47$id. 
     48 
     49=cut 
     50 
    1951sub get_object { 
    2052    my ($self, $otype, $id) = @_; 
     
    2355} 
    2456 
     57=head2 is_transactionnal 
    2558 
    26 # Preloaded methods go here. 
     59Return True is the database support commit and rollback 
     60 
     61=cut 
     62 
     63sub is_transactionnal { 
     64    my ($self) = @_; 
     65    return($self->can('_rollback') && $self->can('_commit')); 
     66} 
     67 
     68=head2 commit 
     69 
     70Save change into the database if change are not done immediately. 
     71This should always be called as you don't know when change are applied. 
     72 
     73Return always true if database does not support any transaction. 
     74 
     75The driver should provides a _commit functions to save data. 
     76 
     77=cut 
     78 
     79sub commit { 
     80    my ($self) = @_; 
     81    return $self->can('_commit') ? $self->_commit : 1; 
     82} 
     83 
     84=head2 rollback 
     85 
     86If database support transaction, rollback changes. Return false 
     87if database does not support. 
     88 
     89If supported, driver should provides a _rollback functions 
     90 
     91=cut 
     92 
     93sub rollback { 
     94    my ($self) = @_; 
     95    return $self->can('_rollback') ? $self->_commit : 0; 
     96} 
    2797 
    28981; 
     99 
    29100__END__ 
    30 # Below is stub documentation for your module. You'd better edit it! 
    31  
    32 =head1 NAME 
    33  
    34 LATMOS::Accounts::Bases - Perl extension for blah blah blah 
    35  
    36 =head1 SYNOPSIS 
    37  
    38   use LATMOS::Accounts::Bases; 
    39   blah blah blah 
    40  
    41 =head1 DESCRIPTION 
    42  
    43 Stub documentation for LATMOS::Accounts, created by h2xs. It looks like the 
    44 author of the extension was negligent enough to leave the stub 
    45 unedited. 
    46  
    47 Blah blah blah. 
    48  
    49 =head2 EXPORT 
    50  
    51 None by default. 
    52  
    53  
    54101 
    55102=head1 SEE ALSO 
    56103 
    57 Mention other useful documentation such as the documentation of 
    58 related modules or operating system documentation (such as man pages 
    59 in UNIX), or any relevant external documentation such as RFCs or 
    60 standards. 
    61  
    62 If you have a mailing list set up for your module, mention it here. 
    63  
    64 If you have a web site set up for your module, mention it here. 
    65  
    66104=head1 AUTHOR 
    67105 
    68 Thauvin Olivier, E<lt>olivier@localdomainE<gt> 
     106Thauvin Olivier, E<lt>olivier.thauvin.ipsl.fr.thauvin@latmos.ipsl.fr<gt> 
    69107 
    70108=head1 COPYRIGHT AND LICENSE 
     
    76114at your option, any later version of Perl 5 you may have available. 
    77115 
    78  
    79116=cut 
Note: See TracChangeset for help on using the changeset viewer.