- Timestamp:
- 12/21/16 15:07:28 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Objects.pm
r1840 r1865 45 45 46 46 =cut 47 48 =head2 listReal($base) 49 50 List object supported by this module existing in base $base 51 52 Can be override by base driver. The result must exclude specials object such alias. 53 54 =cut 55 56 sub listReal { 57 my ($class, $base) = @_; 58 $class->list($base); 59 } 47 60 48 61 =head2 list_from_rev($base, $rev) … … 68 81 } 69 82 70 # _new($base, $type, $id, ...)71 72 # Return a new object of type $type having unique identifier73 # $id, all remaining arguments are passed to the subclass.74 75 sub _new {76 my ($class, $base, $otype, $id, @args) = @_;77 78 # finding perl class:79 my $pclass = $base->_load_obj_class($otype) or return;80 my $newobj = "$pclass"->new($base, $id, @args);81 82 defined($newobj) or do {83 $base->log(LA_DEBUG, "$pclass->new() returned undef for $otype / %s", $id || '(none)');84 return;85 };86 87 $newobj->{_base} = $base;88 $newobj->{_type} = lc($otype);89 $newobj->{_id} ||= $id;90 91 return $newobj;92 }93 94 83 =head2 _create($class, $base, $id, %data) 95 84 … … 265 254 } 266 255 267 =head2 get_state ($state)268 269 Return an on fly computed value270 271 =cut272 273 sub get_state {274 my ($self, $state) = @_;275 # hum...276 if (defined(my $res = $self->_get_state($state))) {277 return $res;278 }279 for ($state) {280 }281 return;282 }283 284 sub _get_state {285 my ($self, $state) = @_;286 return;287 }288 289 256 sub _get_c_field { 290 257 my ($self, $cfield) = @_; … … 299 266 return $attribute->get; 300 267 } 268 269 =head2 GetAttributeValue($cfield) 270 271 Return the value to exposed to other base 272 273 =cut 274 275 sub GetAttributeValue { 276 my ($self, $cfield) = @_; 277 278 return $self->get_c_field($cfield); 279 } 280 301 281 302 282 =head2 queryformat ($fmt)
Note: See TracChangeset
for help on using the changeset viewer.