[Rt-commit] r6324 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Fri Oct 27 01:42:41 EDT 2006


Author: ruz
Date: Fri Oct 27 01:42:41 2006
New Revision: 6324

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm

Log:
 r4059 at cubic-pc:  cubic | 2006-10-27 07:34:33 +0400
 ::Attachment->ParentObj
 * the new method


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachment_Overlay.pm	Fri Oct 27 01:42:41 2006
@@ -325,6 +325,22 @@
 
 # }}}
 
+=head2 ParentObj
+
+Returns a parent's L<RT::Attachment> object if this attachment
+has a parent, otherwise returns undef.
+
+=cut
+
+sub ParentObj {
+    my $self = shift;
+    return undef unless $self->Parent;
+
+    my $parent = RT::Attachment->new( $self->CurrentUser );
+    $parent->LoadById( $self->Parent );
+    return $parent;
+}
+
 # {{{ sub Children
 
 =head2 Children


More information about the Rt-commit mailing list