#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::DB::Item::ControlledComposition;
use strict;
use warnings;
use lib '/app/tools/common/lib';
use Common::DB::Item;
use base 'Common::DB::Item';

use constant kTable => 'controlled_composition';
use constant kDB => Common::DB::Item::kClientDB();


sub GetByContractID
{
    my ($class, $id) = @_;

	my $sql = "SELECT * FROM ".kTable." WHERE artist_contract_id=$id";

    my $collection = $class->GetAll($sql);

	return ($collection->hasNext()) ? $collection->next() : undef;
}


sub GetByLicenseConfigID
{
    my ($class, $id) = @_;

	my $sql = "SELECT * from ".kTable." where license_config_id=$id";

    return $class->GetAll($sql);
}



1;




