RT 5.0.3 Documentation
RT::Assets
NAME
RT::Assets - a collection of RT::Asset objects
METHODS
Only additional methods or overridden behaviour beyond the RT::SearchBuilder (itself a DBIx::SearchBuilder) class are documented below.
LimitToActiveStatus
LimitCatalog
Limit Catalog
Limit
Defaults CASESENSITIVE to 0
RoleLimit
Re-uses the underlying JOIN, if possible.
LimitField
Takes a paramhash with the fields FIELD, OPERATOR, VALUE and DESCRIPTION Generally best called from LimitFoo methods
INTERNAL METHODS
Public methods which encapsulate implementation details. You shouldn't need to call these in normal code.
AddRecord
Checks the RT::Asset is readable before adding it to the results
PRIVATE METHODS
_Init
Sets default ordering by Name ascending.
_DoSearch
_DoCount
Limits to non-deleted assets unless the allow_deleted_search
flag is set.
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