Home > Class Reference > %SYS namespace > %iKnow.Filters.GroupFilter

%iKnow.Filters.GroupFilter

class %iKnow.Filters.GroupFilter extends %iKnow.Filters.Filter

A generic filter to logically combine any number of %iKnow.Filters.Filter subfilter objects using a boolean AND or OR, optionally inverting the result (NOT) if negated is true.

After initially creating a GroupFilter instance, add subfilters to it using AddSubFilter() or AddSubFilterString().

Filter parameters:

  1. domainId As %Integer
  2. groupLogic As %Integer - either $$$GROUPFILTERAND or $$$GROUPFILTEROR.
  3. negated As %Boolean - indicates whether or not invert (NOT) the combined filter.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property GroupLogic as %Integer [ Final , InitialExpression = $$$GROUPFILTERAND ];
Property methods: GroupLogicDisplayToLogical(), GroupLogicGet(), GroupLogicIsValid(), GroupLogicLogicalToDisplay(), GroupLogicNormalize(), GroupLogicSet()
property Negated as %Boolean [ Final , InitialExpression = 0 ];
Property methods: NegatedDisplayToLogical(), NegatedGet(), NegatedIsValid(), NegatedLogicalToDisplay(), NegatedNormalize(), NegatedSet()
property SubFilters as list of %iKnow.Filters.Filter [ Private , Final ];
Property methods: SubFiltersBuildValueArray(), SubFiltersCollectionToDisplay(), SubFiltersCollectionToOdbc(), SubFiltersDisplayToCollection(), SubFiltersGet(), SubFiltersGetObject(), SubFiltersGetObjectId(), SubFiltersGetSwizzled(), SubFiltersIsValid(), SubFiltersOdbcToCollection(), SubFiltersSet(), SubFiltersSetObject(), SubFiltersSetObjectId()

Methods (Including Private)

private method %OnNew(DomainId As %Integer, GroupLogic As %String = "AND", Negated As %Boolean = 0, UseCache As %Integer = 0) as %Status [ Language = objectscript ]
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

final method AddSubFilter(SubFilter As %iKnow.Filters.Filter) as %Status [ Language = objectscript ]

Adds a %iKnow.Filters.Filter object to this instance as a subfilter, which will be ANDed or ORed according to this instances groupLogic property.

final method AddSubFilterString(SubFilterString As %String) as %Status [ Language = objectscript ]

Adds a %iKnow.Filters.Filter object in its %String format (see ToString()) to this instance as a subfilter, which will be ANDed or ORed according to this instances groupLogic property.

private method BuildSourceFilter(maxOffset As %Integer) as %Status [ Language = objectscript ]
Inherited description:

This is the primary method that needs to be implemented by an actual %iKnow.Filters.Filter subclass to translate the abstract filter criteria the subclass addresses into a bitstring based on Source IDs. The subclass' implementation of this method should use SetSourceBits() for this purpose, setting the requested bitstrings for each offset up to maxOffset.

final method GetSubFilterAt(index As %Integer) as %iKnow.Filters.Filter [ Language = objectscript ]
Returns the subfilter at the specified index, if any
final method GetSubFilterCount() as %Integer [ Language = objectscript ]
Returns the number of subfilters currently registered in this GroupFilter instance.
classmethod RestoreFilterFromStringInternal(filterSpec As %String) as %iKnow.Filters.Filter [ Language = objectscript ]
Inherited description:

Default implementation, with the filterParams corresponding to all %New() arguments. See also RestoreFilterFromString().

method ToString() as %String [ Language = objectscript ]
Inherited description:

Subclasses should implement this method to build a string representation of the filter instance. It should start with the filter class name, followed by a pipe (|) character and then a string representation that can be interpreted by its RestoreFilterFromStringInternal() implementation.

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)

Feedback