Audio-DB

 view release on metacpan or  search on metacpan

DB/Query.pm  view on Meta::CPAN

package Audio::DB::Query;

# $Id: Query.pm,v 1.2 2005/02/27 16:56:25 todd Exp $

use strict 'vars';
use vars qw(@ISA $VERSION);
#use Apache::Constants qw(:common REDIRECT HTTP_NO_CONTENT);
#use CGI qw/:standard *table *div *TR/;
#use CGI::Cookie;
use DBI;

use Audio::DB::Factory;
use Audio::DB::Util::Rearrange;
use Audio::DB::Util::SystemConfig;
use Audio::DB::Util::Playlists;

use Audio::DB::DataTypes::Artist;
use Audio::DB::DataTypes::Album;
use Audio::DB::DataTypes::Genre;
#use Audio::DB::DataTypes::ArtistList;
#use Audio::DB::DataTypes::AlbumList;
#use Audio::DB::DataTypes::SongList;

@ISA = qw/Audio::DB::Util::DataAccess Audio::DB::Factory/;

=pod

=head1 NAME

Audio::DB::Query - query methods of a Audio::DB database

=head1 SYNOPSIS

Audio::DB::Query objects are used internally by Audio::DB::Reports and
Audio::DB::Web.  You will not normally interact with Audio::DB::Query
objects.  The documentation contained here is listed for completeness
as well as for those looking to extend the functionality of Audio::DB.

=head1 METHODS

=over 4

=cut

=pod

=item $report->fetch_class(@options);

Provided with a table name, fetch_class returns an array reference of
appropriate objects. For example, passing the -class=>'artists' option
results in an array reference of Audio::DB::DataTypes::Artist objects.

 Options:

Some classes accept additional parameters.

 Class: albums

 TODO: COMPLETE
   By default, album objects will not be populated with songs. To retreive populated Album objects, try using ...

   If provided, Album objects will be populated with Song
   objects. These can be accessed by calling the songs() method on
   each album object.

   @albums = $music->fetch_class(-class=>'artist');
   foreach my $album_obj (@albums) {
     print $album_obj->album,"\n";
     print join("\n",map {$_->title} $album_obj->songs);



( run in 1.794 second using v1.01-cache-2.11-cpan-9581c071862 )