LimitField

Takes a paramhash with the fields FIELD, OPERATOR, VALUE and DESCRIPTION Generally best called from LimitFoo methods

Limit Helper Routines

These routines are the targets of a dispatch table depending on the type of field. They all share the same signature:

my ($self,$field,$op,$value,@rest) = @_;

The values in @rest should be suitable for passing directly to DBIx::SearchBuilder::Limit.

Essentially they are an expanded/broken out (and much simplified) version of what ProcessRestrictions used to do. They're also much more clearly delineated by the TYPE of field being processed.

_IdLimit

Handle ID field.

_EnumLimit

Handle Fields which are limited to certain values, and potentially need to be looked up from another class.

This subroutine actually handles two different kinds of fields. For some the user is responsible for limiting the values. (i.e. Status, Type).

For others, the value specified by the user will be looked by via specified class.

Meta Data: name of class to lookup in (Optional)

_IntLimit

Handle fields where the values are limited to integers. (For example, Priority, TimeWorked.)

Meta Data: None

_LinkLimit

Handle fields which deal with links between assets. (MemberOf, DependsOn)

Meta Data: 1: Direction (From, To) 2: Link Type (MemberOf, DependsOn, RefersTo)

_DateLimit

Handle date fields. (Created, LastTold..)

Meta Data: 1: type of link. (Probably not necessary.)

_StringLimit

Handle simple fields which are just strings. (Subject,Type)

Meta Data: None

_WatcherLimit

Handle watcher limits. (Requestor, CC, etc..)

Meta Data: 1: Field to query on

_WatcherMembershipLimit

Handle watcher membership limits, i.e. whether the watcher belongs to a specific group or not.

Meta Data: 1: Role to query on

_CustomFieldDecipher

Try and turn a CF descriptor into (cfid, cfname) object pair.

Takes an optional second parameter of the CF LookupType, defaults to Asset CFs.

_CustomFieldLimit

Limit based on CustomFields

Meta Data: none

PrepForSerialization

You don't want to serialize a big assets object, as the {items} hash will be instantly invalid _and_ eat lots of space

FromSQL

Convert a RT-SQL string into a set of SearchBuilder restrictions.

Returns (1, 'Status message') on success and (0, 'Error Message') on failure.

Query

Returns the last string passed to "FromSQL".

ClearRestrictions

Removes all restrictions irretrievably

ClausesToSQL