[CDBI] IsA wiping out the my base search
[prev]
[thread]
[next]
[Date index for 2005/10/31]
---------- Forwarded message ----------
From: Peter Speltz <peterspeltz@xxxxx.xxx>
Date: Oct 31, 2005 8:54 AM
Subject: Re: [CDBI] IsA wiping out the my base search
To: "Randal L. Schwartz" <merlyn@xxxxxxxxxx.xxx>
On 31 Oct 2005 06:01:10 -0800, Randal L. Schwartz <merlyn@xxxxxxxxxx.xxx> w=
rote:
>
> SubClass ->search () # calls base search
>
> SubClass->SUPER::search ( ) # calls IsA search
>
> SUPER:: is tied to __PACKAGE__. Something like this will work
> if you're in a {package SubClass; ... } area, but not in general.
>
> What are you actually trying to accomplish?
>
I am using Maypole::Model::CDBI as my base class. It has an action
method named "search". This mehod really has nothing to do with the
CDBI's search (constructor) except that it calls it within it to
well do the search and that CDBI is a base class to it so it
overrides it in a sense.
So what I have for class structure:
Subclass
MaypoleCDBI
Class::DBI
SubClass IsA SubClass2. . IsA wants to override CDBI's standard
search to do a join search on the two tables (SubClass and SubClass2
tables). It does this by injectin a "search" method into the
SubClass package. However this is not the ideal place in the
inheritance structure for it. It should be betwenn MaypoleCDBI and
Class:;DBI .
Make sense? I am starting to see the lunacy in this. But it seems
like a reasonable expectation though. Maybe it needs to do a trick
like Maypole::Model:;CDBI does at the beginning:
return shift->SUPER::search(@_) if caller ne "Maypole::Model::Base";
except with the appropriate clauses:
return SubClass->original_search if we are not wanting to do a CDBI searc=
h .
thanks
--
pjs
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi