[bugzilla-gnome-org-extensions] product interests: Move string into separate sub
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bugzilla-gnome-org-extensions] product interests: Move string into separate sub
- Date: Thu, 20 Nov 2014 22:05:16 +0000 (UTC)
commit e2c57c0040251cd1d5bfcdc79ba59da3fcfb32e5
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Sat Nov 8 19:16:39 2014 +0100
product interests: Move string into separate sub
ProductInterests/Extension.pm | 7 ++++---
ProductInterests/lib/Util.pm | 5 +++++
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ProductInterests/Extension.pm b/ProductInterests/Extension.pm
index 5901c2f..e385ca7 100644
--- a/ProductInterests/Extension.pm
+++ b/ProductInterests/Extension.pm
@@ -22,6 +22,7 @@
package Bugzilla::Extension::ProductInterests;
use strict;
use base qw(Bugzilla::Extension);
+use Bugzilla::Extension::ProductInterests::Util;
our $VERSION = '0.01';
@@ -33,7 +34,7 @@ BEGIN {
sub product_interests {
my $self = shift;
- return $self->{'product_int'} if defined $self->{'product_int'};
+ return $self->{p_i()} if defined $self->{p_i()};
return [] unless $self->id;
my $product_ids = Bugzilla->dbh->selectcol_arrayref(
@@ -48,9 +49,9 @@ sub product_interests {
ORDER BY products.name},
undef, ($self->id, $self->id));
- $self->{'product_int'} = Bugzilla::Product->new_from_list($product_ids);
+ $self->{p_i()} = Bugzilla::Product->new_from_list($product_ids);
- return $self->{'product_int'};
+ return $self->{p_i()};
}
diff --git a/ProductInterests/lib/Util.pm b/ProductInterests/lib/Util.pm
index dc87d31..e239e64 100644
--- a/ProductInterests/lib/Util.pm
+++ b/ProductInterests/lib/Util.pm
@@ -23,6 +23,7 @@ package Bugzilla::Extension::ProductInterests::Util;
use strict;
use base qw(Exporter);
our @EXPORT = qw(
+ p_i
);
# This file can be loaded by your extension via
@@ -30,4 +31,8 @@ our @EXPORT = qw(
# used by your extension in here. (Make sure you also list them in
# @EXPORT.)
+sub p_i {
+ 'product_int'
+}
+
1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]