Limiting Forms: Difference between revisions

From IHRIS Wiki
Line 5: Line 5:
*Report Limits
*Report Limits
=Limit Styles=
=Limit Styles=
There are many ways that you may wish to limit the values of a particular field, we refer to these as a '''limit style.'''  Recall that every field is has a type, such as INT or INT_LIST, which translates to a class, such as I2CE_FormField_INT or I2CE_FormField_INT_LIST, all of which sub-class I2CE_FormField.  A type is made available to some sub-class (as well as well of all of its sub-classes) of I2CE_FormField.
There are many ways that you may wish to limit the values of a particular field, we refer to these as a '''limit style.'''  For example, ''equals'' or ''like.''
 
Recall that every field is has a type, such as INT or INT_LIST, which translates to a class, such as I2CE_FormField_INT or I2CE_FormField_INT_LIST, all of which sub-class I2CE_FormField.  A type is made available to some sub-class (as well as well of all of its sub-classes) of I2CE_FormField.


Most of these limit style, and their attendant code, can be found in the module '''form-limits.'''
Most of these limit style, and their attendant code, can be found in the module '''form-limits.'''
=Existing Styles=
=Existing Styles=
These are the limit styles provided by ''form-limits'' version 3.2.0.  Please see the class itself for more up-to-date information.
These are the limit styles provided by ''form-limits'' version 3.2.0.  Please see the class itself for more up-to-date information.

Revision as of 09:23, 20 March 2009

In version 3.2 and greater we have unified the ability to search for forms by limiting the values of their fields. This is used in, for example:

  • I2CE_Form::search()
  • I2CE_Form::listFields()
  • Form Relationships
  • Report Limits

Limit Styles

There are many ways that you may wish to limit the values of a particular field, we refer to these as a limit style. For example, equals or like.

Recall that every field is has a type, such as INT or INT_LIST, which translates to a class, such as I2CE_FormField_INT or I2CE_FormField_INT_LIST, all of which sub-class I2CE_FormField. A type is made available to some sub-class (as well as well of all of its sub-classes) of I2CE_FormField.

Most of these limit style, and their attendant code, can be found in the module form-limits.

Existing Styles

These are the limit styles provided by form-limits version 3.2.0. Please see the class itself for more up-to-date information.

  • I2CE_FormField
    • null
    • not_null
    • max_parent
    • min_parent
    • max_parent_form
    • min_parent_form
  • I2CE_FormField_BOOL
    • truefalse
    • true
    • false
  • I2CE_FormField_DB_DATE
    • greaterthan_now
    • lessthan_now
  • I2CE_FormField_DB_INT
    • between
    • equals
    • in
    • greaterthan
    • greaterthan_equals
    • lessthan
    • lessthan_equals
  • I2CE_FormField_DB_STRING
    • between
    • equals
    • in
    • greaterthan
    • greaterthan_equals
    • lessthan
    • lessthan_equals
    • like
  • I2CE_FormField_DB_TEXT
    • between
    • equals
    • in
    • greaterthan
    • greaterthan_equals
    • lessthan
    • lessthan_equals
    • like
  • I2CE_FormField_YESNO
    • yesno
    • yes
    • no