RT::Assets - a collection of RT::Asset objects
Only additional methods or overridden behaviour beyond the RT::SearchBuilder (itself a DBIx::SearchBuilder) class are documented below.
Limit Catalog
Defaults CASESENSITIVE to 0
Re-uses the underlying JOIN, if possible.
Takes a paramhash with the fields FIELD, OPERATOR, VALUE and DESCRIPTION Generally best called from LimitFoo methods
Public methods which encapsulate implementation details. You shouldn't need to call these in normal code.
Checks the RT::Asset is readable before adding it to the results
Sets default ordering by Name ascending.
Limits to non-deleted assets unless the allow_deleted_search
flag is set.
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.
Handle ID field.
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)
Handle fields where the values are limited to integers. (For example, Priority, TimeWorked.)
Meta Data: None
Handle fields which deal with links between assets. (MemberOf, DependsOn)
Meta Data: 1: Direction (From, To) 2: Link Type (MemberOf, DependsOn, RefersTo)
Handle date fields. (Created, LastTold..)
Meta Data: 1: type of link. (Probably not necessary.)
Handle simple fields which are just strings. (Subject,Type)
Meta Data: None
Handle watcher limits. (Requestor, CC, etc..)
Meta Data: 1: Field to query on
Handle watcher membership limits, i.e. whether the watcher belongs to a specific group or not.
Meta Data: 1: Role to query on
Try and turn a CF descriptor into (cfid, cfname) object pair.
Takes an optional second parameter of the CF LookupType, defaults to Asset CFs.
Limit based on CustomFields
Meta Data: none
You don't want to serialize a big assets object, as the {items} hash will be instantly invalid _and_ eat lots of space
Convert a RT-SQL string into a set of SearchBuilder restrictions.
Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
Returns the last string passed to "FromSQL".
Removes all restrictions irretrievably