Move get_tables from Meta/Class into Meta/Asset. s/getTables/meta->get_tables/;

This commit is contained in:
Colin Kuskie 2010-01-04 15:34:24 -08:00
parent b72e3a1cd1
commit ce3edcf743
8 changed files with 74 additions and 38 deletions

View file

@ -131,7 +131,7 @@ sub addRevision {
}
# prime the tables
foreach my $table ($self->getTables) {
foreach my $table ($self->meta->get_tables) {
unless ($table eq "assetData") {
$self->session->db->write( "insert into ".$table." (assetId,revisionDate) values (?,?)", [$self->getId, $now]);
}
@ -355,7 +355,7 @@ sub purgeRevision {
if ($self->getRevisionCount > 1) {
my $db = $self->session->db;
$db->beginTransaction;
foreach my $table ($self->getTables) {
foreach my $table ($self->meta->get_tables) {
$db->write("delete from ".$table." where assetId=? and revisionDate=?",[$self->getId, $self->get("revisionDate")]);
}
my $count = $db->quickScalar("select count(*) from assetData where assetId=? and status='pending'",[$self->getId]);