Developer
User Docs ↗

NAME

RT::SavedSearch - an API for saving and retrieving search form values.

SYNOPSIS

  use RT::SavedSearch

DESCRIPTION

SavedSearch is an object based on RT::SharedSetting that can belong to either an RT::User or an RT::Group. It consists of an ID, a description, and a number of search parameters.

METHODS

ObjectName

An object of this class is called "search"

PostLoadValidate

Ensure that the ID corresponds to an actual saved search, since it's all attributes under the hood. RT's built-in searches are named Search - name rather than SavedSearch, so they count too.

CurrentUserCanCreate [PRIVACY]

Returns true if the current user may save a search under PRIVACY, which defaults to this search's own privacy, asking "LookupObjectRight" in RT::Attribute so that the answer is the one "Create" in RT::Attribute would give.

The other CurrentUserCan* methods are still RT::SharedSetting's, which leave the question to RT::Attribute. This one is here because a caller that wants to move a search has to ask about a container it has not reached yet.

RT::SavedSearch->EscapeDescription STRING

This is a class method because system-level saved searches aren't true RT::SavedSearch objects but direct RT::Attribute objects.

Returns STRING with all square brackets except those in [_1] escaped, ready for passing as the first argument to loc().

Type

Returns the type of this search, e.g. 'Ticket'. Useful for denoting the saved searches that are relevant to a particular search page.

ObjectsForCreating

In the context of the current user, load a list of objects that could have searches saved under, including the current user and groups. This method considers both rights and group membership when creating the list of objects for saved searches.

ShortenerObj

Return the corresponding shortener object

← Back to index