Commit 3c3c249c authored by Web Admin's avatar Web Admin
Browse files

added another scalar_attribute rapper get_first_scalar_attibute which gets...

added another scalar_attribute rapper get_first_scalar_attibute which gets first non-null value from a list of IDs
parent d2d78819
......@@ -325,6 +325,14 @@ sub get_scalar_attribute {
return @results ? $results[0]->value() : '';
}
sub get_first_scalar_attribute {
my $self = shift;
foreach my $code ( @_ ) {
my @results = grep { uc( $_->code() ) eq uc( $code )} @{$self->{'attributes'}};
return $results[0]->value() if @results;
}
return '';
}
=head2 display_id
Arg [1] : none
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment