Ignore:
Timestamp:
12/21/16 15:07:28 (7 years ago)
Author:
nanardon
Message:

Merge branch

File:
1 edited

Legend:

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

    r1840 r1865  
    4545 
    4646=cut 
     47 
     48=head2 listReal($base) 
     49 
     50List object supported by this module existing in base $base 
     51 
     52Can be override by base driver. The result must exclude specials object such alias. 
     53 
     54=cut 
     55 
     56sub listReal { 
     57    my ($class, $base) = @_; 
     58    $class->list($base); 
     59} 
    4760 
    4861=head2 list_from_rev($base, $rev) 
     
    6881} 
    6982 
    70 # _new($base, $type, $id, ...) 
    71  
    72 # Return a new object of type $type having unique identifier 
    73 # $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  
    9483=head2 _create($class, $base, $id, %data) 
    9584 
     
    265254} 
    266255 
    267 =head2 get_state ($state) 
    268  
    269 Return an on fly computed value 
    270  
    271 =cut 
    272  
    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  
    289256sub _get_c_field { 
    290257    my ($self, $cfield) = @_; 
     
    299266    return $attribute->get;  
    300267} 
     268 
     269=head2 GetAttributeValue($cfield) 
     270 
     271Return the value to exposed to other base 
     272 
     273=cut 
     274 
     275sub GetAttributeValue { 
     276    my ($self, $cfield) = @_; 
     277 
     278    return $self->get_c_field($cfield); 
     279} 
     280 
    301281 
    302282=head2 queryformat ($fmt) 
Note: See TracChangeset for help on using the changeset viewer.