[rt-devel] extending rt3 classes? (fwd)

Nick Pleis NickP at cesinc.com
Thu Oct 9 15:18:51 EDT 2003


I'm assuming the database table that your using will mirror that
RT3->Tickets. 

I BELIEVE that you can subclass the RT::Ticket table with no problems. What
you'll actually be subclassing is the aggregate of RT::Ticket and
RT::Ticket*_Overlay. Since the process of resolving the inheritance tree
involves the full resolution of the parents class, it will 'pull in' all of
the overlays and what you'll actually be overriding are those overlay
methods.

Basically, you can think of the Ticket and all of it's overlay modules as
one big module... With the order of resolution being defined in the file (I
don't remember what it is off the top of my head).

I BELIEVE that this is how it works...

On a more general note, it will likely be MUCH easier to build your own
searchbuilder (or RT::Record) derived class instead of using RT::Ticket as
your starting point. Building a SearchBuilder class isn't really that
difficult, and given the amount of overrides you would likely be doing by
overriding the Ticket class, you MAY be much better off inheriting from
RT::Record or Dbix::SearchBuilder::Record.

Nick

-----Original Message-----
From: Alex Porras [mailto:alex at mediaocean.com] 
Sent: Thursday, October 09, 2003 1:55 PM
To: RT-Devel List
Cc: darren chamberlain
Subject: Re: [rt-devel] extending rt3 classes? (fwd)


Sorry, I forgot to include the list.

On Thu, 9 Oct 2003, darren chamberlain wrote:

> * Alex Porras <alex at mediaocean.com> [2003-10-09 13:18]:
> > Can someone point me to some documentation for extending rt3 
> > classes?
> 
> The *_Local.pm files are where you would add your local changes.  If 
> the _Local.pm file doesn't exist, you can simply make it.  The end of 
> each .pm file has something like:
> 
>         eval "require RT::Tickets_Local";
>         if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Local.pm}) {
>             die $@;
>         };

I did notice that.  Maybe I'm confused with the purpose of the _Overlay 
and _Local structure.  If I don't want the functionality to affect tickets 
themselves, how would I do that?  With subclassing, I could create a class 
just like ticket and have the web inteface use it, and ticket would be 
left alone.  However, if I create Ticket_Local.pm it will also affect the 
parts that use Ticket.pm.

--Alex



_______________________________________________
rt-devel mailing list
rt-devel at lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pallas.eruditorum.org/pipermail/rt-devel/attachments/20031009/2a296239/attachment.htm


More information about the Rt-devel mailing list