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

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


Author: ruz
Date: Fri Oct 27 01:42:05 2006
New Revision: 6321

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

Log:
 r4056 at cubic-pc:  cubic | 2006-10-27 07:27:50 +0400
 ::Attachments->Next
 * do less calls
 * simplify it a little, that was crazy


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:05 2006
@@ -325,18 +325,36 @@
 
 # }}}
 
+=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
 
-Returns an RT::Attachments object which is preloaded with all Attachments objects with this Attachment\'s Id as their 'Parent'
+Returns an L<RT::Attachments> object which is preloaded with
+all attachments objects with this attachment\'s Id as their
+C<Parent>.
 
 =cut
 
 sub Children {
     my $self = shift;
     
-    my $kids = new RT::Attachments($self->CurrentUser);
+    my $kids = RT::Attachments->new( $self->CurrentUser );
     $kids->ChildrenOf( $self->Id );
     return($kids);
 }
@@ -429,8 +447,8 @@
 Returns this object's headers as a string.  This method specifically
 removes the RT-Send-Bcc: header, so as to never reveal to whom RT sent a Bcc.
 We need to record the RT-Send-Cc and RT-Send-Bcc values so that we can actually send
-out mail. (The mailing rules are separated from the ticket update code by
-an abstraction barrier that makes it impossible to pass this data directly
+out mail. The mailing rules are separated from the ticket update code by
+an abstraction barrier that makes it impossible to pass this data directly.
 
 =cut
 


More information about the Rt-commit mailing list