package YV::Table::ArticleAuthor;
use base 'YV::Table::DBI';
__PACKAGE__->table('article_authors');
__PACKAGE__->columns(All => qw/author_id article_id/);
__PACKAGE__->hasa(YV::Table::Author => 'author_id');
__PACKAGE__->hasa(YV::Table::Article => 'article_id');
# other methods
####
use YV::Table::ArticleAuthor;
# this is built dynamically...
my %delete_article_xref = (
23 => 1,
);
# $author is an YV::Table::Author object initialized prior..
my @author_articles = YV::Table::ArticleAuthor->search(author_id => $author->id);
# delete cross reference for $author and article id
# (In affect, I want to 'disassociate' article with $article_id from the $author)
for (@author_articles) {
next unless $delete_article_xref{$_->article_id};
$_[0]->delete();
}
####
__PACKAGE__->columns(All => qw/article_id author_id/);
####
# Under Construction