#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Publisher::AffiliateList;


use strict;
use warnings;
use Carp;

use lib '/app/tools/common/lib';
use Common::Assert;


use lib '/app/tools/rps/lib';
use Common::FormObject;
use RPS::Publisher::Affiliate;
use RPS::DB::Item::Affiliate;


use base 'Common::FormObject';

sub _init
{
	my ($self, %args) = @_;

	$self->SUPER::_init(%args);


	$self->{Affiliate} = [];
	my $collection = RPS::DB::Item::Affiliate->GetAllAffiliates();

	while ($collection->hasNext())
	{
		my $obj = $collection->next();

		push @{$self->{Affiliate}}, new RPS::Publisher::Affiliate(_dbItem => $obj);
	}

	return $self;
}

sub _listProperties
{
	return
	{
		Affiliate => 1
	};
}



1;

