package MPDatabase::Article; use strict; use base 'MPDatabase::DBI'; __PACKAGE__->table('article'); __PACKAGE__->columns(Primary => qw/articleId/); __PACKAGE__->columns(All => qw/articleId topicId authorId title intro body postDateTime/); __PACKAGE__->has_a(topicId => 'MPDatabase::Topic'); __PACKAGE__->has_a(authorId => 'MPDatabase::Author'); __PACKAGE__->might_have( topic_class => 'MPDatabase::Topic' => qw/topic relativeImagePath imagePath alt/); __PACKAGE__->might_have( author_class => 'MPDatabase::Author' => qw/author email/); 1;