- Timestamp:
- 04/29/15 20:24:15 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Attributes.pm
r1315 r1329 396 396 sub delayed { $_[0]->{delayed} || 0 } 397 397 398 =head2 get ($attr)398 =head2 get 399 399 400 400 Return the value for this attribute … … 405 405 my ($self) = @_; 406 406 407 if (ref $self->{get}eq 'CODE') {407 if (ref($self->{get}) eq 'CODE') { 408 408 return $self->{get}->($self); 409 } els e{409 } elsif (defined($self->object)) { 410 410 return $self->object->get_field($self->iname); 411 } 412 } 411 } else { 412 return; 413 } 414 } 415 416 =head2 getValues 417 418 Return value for this attribute, results are always return as an array 419 420 =cut 421 422 sub getValues { 423 my ($self) = @_; 424 425 my $res = $self->get(); 426 427 return ref $res ? grep { $_ } @{ $res } : $res; 428 } 429 413 430 414 431 =head2 set ($values)
Note: See TracChangeset
for help on using the changeset viewer.