summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Object.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-09-24 09:55:05 +0200
committermkanat%bugzilla.org <>2008-09-24 09:55:05 +0200
commit4ab6c90fff265849d9284b5d4f9aca93da231edd (patch)
treec0a4c366a9086560ec3602c65131e28c2c0bd90f /Bugzilla/Object.pm
parentda12b9b0e2661b02133a0ed27f26811e8a79e117 (diff)
downloadbugzilla-4ab6c90fff265849d9284b5d4f9aca93da231edd.tar.gz
bugzilla-4ab6c90fff265849d9284b5d4f9aca93da231edd.tar.xz
Bug 357904: Create an object for a Field Value and have Bugzilla::Field->legal_values use it
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat
Diffstat (limited to 'Bugzilla/Object.pm')
-rw-r--r--Bugzilla/Object.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index d616bb2da..bcd436484 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -63,7 +63,10 @@ sub _init {
my $name_field = $class->NAME_FIELD;
my $id_field = $class->ID_FIELD;
- my $id = $param unless (ref $param eq 'HASH');
+ my $id = $param;
+ if (ref $param eq 'HASH') {
+ $id = $param->{id};
+ }
my $object;
if (defined $id) {
@@ -511,7 +514,9 @@ as the value in the L</ID_FIELD> column).
If you pass in a hashref, you can pass a C<name> key. The
value of the C<name> key is the case-insensitive name of the object
-(from L</NAME_FIELD>) in the DB.
+(from L</NAME_FIELD>) in the DB. You can also pass in an C<id> key
+which will be interpreted as the id of the object you want (overriding the
+C<name> key).
B<Additional Parameters Available for Subclasses>