[Solar-talk] Using validateInList filter in Model

Raymond Kolbe rkolbe at gmail.com
Sun Feb 10 14:59:00 CST 2008


Hey all,

I am trying to use validateInList in one of my models and I am having some
trouble.

I have an int col and I only want people to be able to set the number
between 1 - 10. I also want Solar to auto create the form when I call
Solar_Sql_Model_Record::form($cols).

So, I figured that using $_addFilter('priority', 'validateInList', NULL,
array(1, 2, 3...,9, 10); would work except that the NULL in there is the
first arg passed to validateInList....a problem as NULL will never == int or
anything for that matter.

So, my question is, how would I get this filter setup in the model to be
able to actually validate the data coming through? How should the arg be
passed to _addFilter? Currently instead of NULL I am just calling the values
from array(1, 2, 3...9, 10); again.

Thanks,
Raymond K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20080210/1c00bacf/attachment.html


More information about the Solar-talk mailing list