[Solar-talk] Filter stack - Solar does not search Vendor_Filter or Vendor_Model_ for filters

Raymond Kolbe rkolbe at gmail.com
Wed Dec 5 09:37:13 CST 2007


I guess the only real way to get what I want right now is to do this:

Vendor_Sql_Model_Filter extends Vendor_Filter
Vendor_Filter extends Solar_Sql_Model_Filter
Solar_Sql_Model_Filter extends Solar_Filter

This way I get a stack of:

Solar_Filter_
Solar_Sql_Model_Filter_
Vendor_Filter_
Vendor_Sql_Model_Filter_

I still need to do some testing with this to make sure it is not going to
screw other things up (e.g. having Vendor_Filter extend
Solar_Sql_Model_Filter)



On Dec 5, 2007 10:21 AM, Raymond Kolbe <rkolbe at gmail.com> wrote:

> Antti,
>
> That does search the vendor stack properly now, however, it removes
> Solar_Sql_Model_Filter from the picture here and it so happens I am using
> ValidateUnique.
>
> I will play around with this a bit more today and hopefully come up with a
> decent solution.
>
> Thanks all for your help!
>
> Raymond Kolbe
>
>
> On Dec 5, 2007 2:58 AM, Antti Holvikari <anttih at gmail.com> wrote:
>
> > On Dec 4, 2007 11:39 PM, Raymond Kolbe <rkolbe at gmail.com> wrote:
> > > Hello all,
> > >
> > > I have created a filter called sanitizeMD5 which takes a value
> > (string) and
> > > an optional salt (string) and returns the appropriate MD5 hash. I have
> > added
> > > $this->_addFilter('password', 'sanitizeMD5'); to my Vendor_Model_Users
> > model
> > > but Solar throws an exception
> > (Solar_Class_Stack_Exception_ClassNotFound)
> > > stating it can not find the class sanitizeMD5. It appears that Solar
> > is only
> > > searching Solar_Filter_ and Solar_Sql_Model_Filter_ directories for
> > filters.
> > >
> > > Seeing how this is my first attempt with Solar_Stack I am asking for
> > your
> > > help. How can I make Solar search (at the very least)
> > > Vendor_Model_User_Filter and/or Vendor_Filter directories?
> > >
> > > Also, I vote that (if it isn't already) this be added into Solar base
> > code
> > > for ease of use.
> > >
> > > Any advice, comments, and/or suggestions are welcome.
> >
> > If you want to put two custom dirs to the search stack, things get
> > little tricky. I suggest that you put your filter (md5) under
> > Vendor_Filter. Then Add a class Vendor_Model_Filter and have that
> > extend Vendor_Filter (create this class too). In Vendor_Model (or in
> > the model you are using) write this:
> >
> >    protected $_filter_class = 'Vendor_Model_Filter';
> >
> > I think that should do it :-)
> >
> > --
> > Antti Holvikari
> > _______________________________________________
> > Solar-talk mailing list
> > Solar-talk at lists.solarphp.com
> > http://mailman-mail3.webfaction.com/listinfo/solar-talk
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20071205/cc197249/attachment-0001.html


More information about the Solar-talk mailing list