Refines this attribute's reference result. The provided criterium will be added to the 'where' clause (or a 'where' clause will be added).
This method can be called several times, thus allowing a field-by-field handling of an html search form.
All criteria will be merged with the sql 'and' operator (if there is an initial where clause, it is wrapped into parenthesis).
Example : suppose we have defined the attribute 'person.children' as " *person(person_id):select * from person where parent_id=?". Then, if we issue the following calls from inside the template :
$bob.children.refine("age>18")
$bob.children.refine("gender='F'")
the resulting query that will be issed is :
select * from person where (parent_id=?) and (age>18) and (gender='F')
Parameters: criterium - a valid sql condition |