Changeset 3 for LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
- Timestamp:
- 02/26/09 05:52:34 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r2 r3 6 6 use LATMOS::Accounts::Bases::Objects; 7 7 8 our $VERSION = (q$Rev$ =~ /$Rev: (\d+) /)[0]; 8 our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 9 10 =head1 NAME 11 12 LATMOS::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 22 This module provide basic functions for various account base 23 24 =head1 FUNTIONS 25 26 =cut 27 28 =head2 new($type, %options) 29 30 Return, if success, a new data base account object, $type is 31 account base type, %options to setup the base. 32 33 =cut 9 34 10 35 sub new { … … 17 42 } 18 43 44 =head2 get_object($type, $id) 45 46 Return an object of $type (typically user or group) having identifier 47 $id. 48 49 =cut 50 19 51 sub get_object { 20 52 my ($self, $otype, $id) = @_; … … 23 55 } 24 56 57 =head2 is_transactionnal 25 58 26 # Preloaded methods go here. 59 Return True is the database support commit and rollback 60 61 =cut 62 63 sub is_transactionnal { 64 my ($self) = @_; 65 return($self->can('_rollback') && $self->can('_commit')); 66 } 67 68 =head2 commit 69 70 Save change into the database if change are not done immediately. 71 This should always be called as you don't know when change are applied. 72 73 Return always true if database does not support any transaction. 74 75 The driver should provides a _commit functions to save data. 76 77 =cut 78 79 sub commit { 80 my ($self) = @_; 81 return $self->can('_commit') ? $self->_commit : 1; 82 } 83 84 =head2 rollback 85 86 If database support transaction, rollback changes. Return false 87 if database does not support. 88 89 If supported, driver should provides a _rollback functions 90 91 =cut 92 93 sub rollback { 94 my ($self) = @_; 95 return $self->can('_rollback') ? $self->_commit : 0; 96 } 27 97 28 98 1; 99 29 100 __END__ 30 # Below is stub documentation for your module. You'd better edit it!31 32 =head1 NAME33 34 LATMOS::Accounts::Bases - Perl extension for blah blah blah35 36 =head1 SYNOPSIS37 38 use LATMOS::Accounts::Bases;39 blah blah blah40 41 =head1 DESCRIPTION42 43 Stub documentation for LATMOS::Accounts, created by h2xs. It looks like the44 author of the extension was negligent enough to leave the stub45 unedited.46 47 Blah blah blah.48 49 =head2 EXPORT50 51 None by default.52 53 54 101 55 102 =head1 SEE ALSO 56 103 57 Mention other useful documentation such as the documentation of58 related modules or operating system documentation (such as man pages59 in UNIX), or any relevant external documentation such as RFCs or60 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 66 104 =head1 AUTHOR 67 105 68 Thauvin Olivier, E<lt>olivier @localdomainE<gt>106 Thauvin Olivier, E<lt>olivier.thauvin.ipsl.fr.thauvin@latmos.ipsl.fr<gt> 69 107 70 108 =head1 COPYRIGHT AND LICENSE … … 76 114 at your option, any later version of Perl 5 you may have available. 77 115 78 79 116 =cut
Note: See TracChangeset
for help on using the changeset viewer.