Changeset 28


Ignore:
Timestamp:
04/22/09 15:45:25 (15 years ago)
Author:
nanardon
Message:
  • add list_objects() functions
Location:
LATMOS-Accounts/lib/LATMOS/Accounts
Files:
2 edited

Legend:

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

    r27 r28  
    7676    my $pclass = $self->_load_obj_class($otype) or return; 
    7777    $pclass->_get_field_name($c_fields); 
     78} 
     79 
     80=head2 list_objects($otype) 
     81 
     82Return the list of UID for object of $otype. 
     83 
     84=cut 
     85 
     86sub list_objects { 
     87    my ($self, $otype) = @_; 
     88    my $pclass = $self->_load_obj_class($otype) or return; 
     89    $pclass->list($self); 
    7890} 
    7991 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Objects.pm

    r27 r28  
    2222=cut 
    2323 
     24=head2 list($base) 
     25 
     26List object supported by this module existing in base $base 
     27 
     28=cut 
     29 
     30sub list { 
     31    my ($class) = @_; 
     32    return; 
     33} 
     34 
    2435=head2 new($base, $id) 
    2536 
     
    2738 
    2839=cut 
     40 
     41sub new { 
     42    my ($class, $base, $id, @args) = @_; 
     43    # So can be call as $class->SUPER::new() 
     44    bless { 
     45        _base => $base, 
     46        _type => ($class =~ m/[^:]*$/)[0], 
     47    }, $class; 
     48} 
    2949 
    3050# _new($base, $type, $id, ...) 
     
    4363    return $newobj; 
    4464} 
     65 
     66=head2 type 
     67 
     68Return the type of the object 
     69 
     70=cut 
    4571 
    4672sub type { 
Note: See TracChangeset for help on using the changeset viewer.