DB/DataTypes/Artist.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
artist_id
2.0
artist
2.0
genres
2.0
CRAP 2.0
1 package Audio::DB::DataTypes::Artist;
2 use strict;
3  
4 use vars qw/@ISA/;
5  
6 #use Audio::DB::DataTypes::ArtistList;
7 #@ISA = qw/Audio::DB::DataTypes::ArtistList/;
8 use Audio::DB::Util::Rearrange;
9  
10  
11  
12 # Data accessort for Artist objects
13  
14 sub artist_id { return shift->{artist_id}; }
15 sub artist { return shift->{artist}; }
16  
17 # THESE MAY NEED TO BE AGGREGATED BY FETCHED SONGS FIRST
18 sub genres {
19 my $self = shift;
20 my @genres = @{$self->{genres}};
21 return @genres;
22 }
23  
24  
25  
26 # Add a song to the object
27 sub add_song {
28 my ($self,$song) = @_;
29 push (@{$self->{songs}},$song);
30 }
31  
32 # Add a genre to the object
33 sub add_genre {
34 my ($self,$genre) = @_;
35 push (@{$self->{genre}},$genre);
36 }
37  
38 # Add an album to the object
39 sub add_album {
40 my ($self,$album) = @_;
41 push (@{$self->{albums}},$album);
42 }
43  
44 1;