Add keywords accessor for looking up Asset keywords.

This commit is contained in:
Colin Kuskie 2010-03-03 11:03:35 -08:00
parent d932543159
commit 122bd26afa
2 changed files with 35 additions and 1 deletions

View file

@ -294,6 +294,27 @@ sub _build_className {
my $self = shift;
return ref $self;
}
has keywords => (
is => 'rw',
init_arg => undef,
builder => '_build_assetKeywords',
lazy => 1,
);
sub _build_assetKeywords {
my $session = shift->session;
return WebGUI::Keyword->new($session);
}
around keywords => sub {
my $orig = shift;
my $self = shift;
if (@_) {
return $self->$orig->setKeywordsForAsset({asset => $self, keywords => $_[0], });
}
else {
return $self->$orig->getKeywordsForAsset({asset => $self});
}
};
around BUILDARGS => sub {
my $orig = shift;