Ignore:
Timestamp:
04/29/15 20:24:15 (9 years ago)
Author:
nanardon
Message:

Merge branch 'jquery'

File:
1 edited

Legend:

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

    r1315 r1329  
    396396sub delayed { $_[0]->{delayed} || 0 } 
    397397 
    398 =head2 get($attr) 
     398=head2 get 
    399399 
    400400Return the value for this attribute 
     
    405405    my ($self) = @_; 
    406406 
    407     if (ref $self->{get} eq 'CODE') { 
     407    if (ref($self->{get}) eq 'CODE') { 
    408408        return $self->{get}->($self); 
    409     } else { 
     409    } elsif (defined($self->object)) { 
    410410        return $self->object->get_field($self->iname); 
    411     } 
    412 } 
     411    } else { 
     412        return; 
     413    } 
     414} 
     415 
     416=head2 getValues 
     417 
     418Return value for this attribute, results are always return as an array 
     419 
     420=cut 
     421 
     422sub getValues { 
     423    my ($self) = @_; 
     424 
     425    my $res = $self->get(); 
     426 
     427    return ref $res ? grep { $_ } @{ $res } : $res; 
     428} 
     429 
    413430 
    414431=head2 set ($values) 
Note: See TracChangeset for help on using the changeset viewer.