Changeset 16 for LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
- Timestamp:
- 03/03/09 19:51:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r7 r16 91 91 } 92 92 93 =head2 create_object($type, $id, %data) 94 95 Create and return an object of type $type with unique id 96 $id having %data. 97 98 This method should be provided by the data base handler. 99 100 =cut 101 102 sub create_object { 103 my ($self, $otype, $id, %data) = @_; 104 return; 105 } 106 107 =head2 create_c_object($type, $id, %data) 108 109 Create and return an object of type $type with unique id 110 $id having %data using canonical fields 111 112 =cut 113 114 sub create_c_object { 115 my ($self, $otype, $id, %cdata) = @_; 116 117 my %data; 118 foreach my $cfield (keys %cdata) { 119 my $field = $self->base->get_field_name($self->type, $cfield) or next; 120 $data{$field} = $cdata{$cfield}; 121 } 122 keys %data or return 1; # TODO: return an error ? 123 $self->create_object($otype, $id, %data); 124 } 125 93 126 =head2 load 94 127
Note: See TracChangeset
for help on using the changeset viewer.