Changeset 7 for LATMOS-Accounts
- Timestamp:
- 02/27/09 21:07:53 (15 years ago)
- Location:
- LATMOS-Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r6 r7 62 62 my ($self, $otype) = @_; 63 63 my $pclass = $self->_load_obj_class($otype) or return; 64 $pclass->canonical_fields; 64 $pclass->_canonical_fields; 65 } 66 67 =head2 get_field_name($otype, $c_fields) 68 69 Return the internal fields name for $otype object for 70 canonical fields $c_fields 71 72 =cut 73 74 sub get_field_name { 75 my ($self, $otype, $c_fields) = @_; 76 my $pclass = $self->_load_obj_class($otype) or return; 77 $pclass->_get_field_name($c_fields); 65 78 } 66 79 -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Objects.pm
r6 r7 49 49 } 50 50 51 =head2 canonical_fields51 =head2 _canonical_fields 52 52 53 53 Must return the list of field supported by the object. 54 55 If exists, _canonicals_fields function is called.56 54 57 55 Notice this query will always come from the upstream data base, … … 63 61 =cut 64 62 65 sub canonical_fields {63 sub _canonical_fields { 66 64 my ($self) = @_; 67 if ($self->can('_canonical_fields')) { 68 $self->_canonical_fields; 69 } else { return; } 65 return; 66 } 67 68 =head2 _get_fields_name($field) 69 70 Return the fields name for canonical field $field 71 72 =cut 73 74 sub _get_field_name { 75 my ($self, $field) = @_; 76 return; 70 77 } 71 78 -
LATMOS-Accounts/t/10_bases.t
r6 r7 1 1 use strict; 2 2 use warnings; 3 use Test::More tests => 1 2;3 use Test::More tests => 13; 4 4 5 5 use_ok('LATMOS::Accounts::Bases'); … … 17 17 18 18 ok(eq_set([ $dummyb->list_canonicals_fields('user') ], []), "Can get canonicals fields"); 19 ok(!defined( $dummyb->get_field_name('any') ), "can call get_fields_name"); 19 20 ok(!$dummyb->is_transactionnal, 'Dummy driver is not transactionnal');
Note: See TracChangeset
for help on using the changeset viewer.