- eval "require RT::ObjectCustomFields_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::ObjectCustomFields_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::ObjectCustomFields_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-Each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::ObjectCustomFields_Overlay, RT::ObjectCustomFields_Vendor, RT::ObjectCustomFields_Local
+sub HasEntryForCustomField {
+ my $self = shift;
+ my $id = shift;
+
+ my @items = grep {$_->CustomField == $id } @{$self->ItemsArrayRef};
+
+ if ($#items > 1) {
+ die "$self HasEntry had a list with more than one of $id in it. this can never happen";
+ }
+ if ($#items == -1 ) {
+ return undef;
+ }
+ else {
+ return ($items[0]);
+ }
+}